Releases: sekoyo/react-image-crop
Releases · sekoyo/react-image-crop
6.0.11
6.0.10
- Auto crop fixing: emit an
onChange
andonComplete
with fixed dimensions if width, height, and aspect are provided but dimensions are invalid for aspect. This makes using aspect crops and switching images easier as you no longer need any special logic inonImageLoaded
since the crop dimensions will be fixed for you. - Add locked prop for when
disabled
orkeepSelection
don't quite fit the bill.
6.0.9
- Revert changes from 6.0.2 -> 6.0.3 which were to make it more convenient to create a client crop preview by calling
onChange
andonChangeComplete
afteronImageLoad
. This meant that users couldn't make adjustments to the crop inonImageLoad
as they were overwritten #223.
Now to make a client crop on the first load you should call your crop preview making function in onImageLoaded
too. See https://codesandbox.io/s/72py4jlll6 for an example.
6.0.8
- Fixes major regression bug (infinite loop) introduced in 6.0.6. Rather than fixing the calc I introduced there I thought it would be more efficient and less risky to just remove it.
If you would like to programatically change the aspect ratio, you should also set the width or height to falsy if you would like the component to complete the crop for you:
// Setting an aspect but not a width or height (you must have ONE of them) will cause
// the component to complete the crop for you:
this.setState(state => ({
crop: {
...state.crop,
aspect: 16/9,
height: null,
},
}))
6.0.7
6.0.6
6.0.5
6.0.4
6.0.3
6.0.2
- Patch release to change order of calls when using aspect crops -
onImageLoaded
is called beforeonChange
andonComplete
so that getting an image reference before making a crop on the client is more convenient in this situation. Note that if you set the image ref to state (which is probably unnecessary), then it won't exist by the timeonChange
andonComplete
are called so it's recommended that you don't. Refer to the sandbox example if you're confused. #213