Skip to content

Releases: sekoyo/react-image-crop

6.0.11

06 Jan 13:30
Compare
Choose a tag to compare

Non-functional release

  • Remove babel-plugin-transform-runtime introduced in 6.0.9 which was only used in the demo and increased bundle size by 100% (don't fear, it was still small) 😳

6.0.10

02 Jan 18:04
Compare
Choose a tag to compare
  • Auto crop fixing: emit an onChange and onComplete 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 in onImageLoaded since the crop dimensions will be fixed for you.
  • Add locked prop for when disabled or keepSelection don't quite fit the bill.

6.0.9

23 Nov 19:01
Compare
Choose a tag to compare
  • 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 and onChangeComplete after onImageLoad. This meant that users couldn't make adjustments to the crop in onImageLoad 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

14 Nov 16:32
Compare
Choose a tag to compare
  • 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

13 Nov 22:53
Compare
Choose a tag to compare
  • Improves min size behaviour introduced in 6.0.5 so that in one drag if the pointer is brought back around and the resize becomes valid it will resize instead of remaining frozen.

6.0.6

13 Nov 22:39
Compare
Choose a tag to compare
  • Fixed crop not updating when the user changes aspect (but not x, y, width or height). Also behaviour is changed so that if width and height are invalid for the aspect they are auto-adjusted. This makes controls to change the aspect more convenient. #133

6.0.5

13 Nov 19:33
Compare
Choose a tag to compare
  • Fix minWidth/minHeight not being respected when flipping over near the image boundaries and not having enough space available (flip is prevented in that case). #206
  • Added ability to specify own window and document if desired. #215

6.0.4

01 Nov 13:29
Compare
Choose a tag to compare
  • Fix to last patch: only call onChange & onComplete on image load if the crop is valid

6.0.3

25 Oct 21:13
Compare
Choose a tag to compare
  • Another improvement for making cropping on the client more simple: now if you pass a crop onChange and onComplete callbacks will be fired just after onImageLoaded in all situations (not just if using aspect crops).

6.0.2

25 Oct 20:58
Compare
Choose a tag to compare
  • Patch release to change order of calls when using aspect crops - onImageLoaded is called before onChange and onComplete 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 time onChange and onComplete are called so it's recommended that you don't. Refer to the sandbox example if you're confused. #213