Skip to content

Releases: dominictobias/react-image-crop

3.0.1

02 Oct 18:29
Compare
Choose a tag to compare
  • Fixed onImageLoaded in the case where the browser has cached the image

3.0.0

01 Oct 15:13
Compare
Choose a tag to compare
  • You must always implement onChange and update the crop state, ReactCrop no longer maintains the crop in it's own state. This is in an effort to make the component more pure and predictable.

  • Due to this change if you specify an aspect you can either omit width and height, or you must specify both. This is because the crop object is now an immutable prop and ReactCrop can't fill it in for you. If you don't know the ratio of the image you should set the crop from inside onImageLoaded:

import ReactCrop, { makeAspectCrop } from 'react-image-crop';

onImageLoaded = (image) => {
  this.setState({
    crop: makeAspectCrop({
      x: 0,
      y: 0,
      aspect: 16 / 9,
      width: 50,
    }, image.width / image.height),
  });
}
  • onImageLoaded only passes the image element as the first parameter.

  • A copy of the image is no longer rendered, increasing performance particularly in the case of a base64 image.

  • keepSelection will not remove the crop even when dragging outside the crop (not just clicking). It also won't hide the resize handles whilst clicking down outside the crop which was causing a flickering effect.

  • ReactCrop--new-crop class changed to ReactCrop--active and on if resizing a crop too.

  • Fixed crop continuing to expand when resizing movement goes outside the image bounds

2.1.1

29 Sep 18:44
Compare
Choose a tag to compare
  • Revert HOC refactor as it broke the component due to requiring two non-existent files in dist/

2.1.0

29 Sep 17:27
Compare
Choose a tag to compare
  • Split component up so it can be used as a HOC
  • Don't render crop handles when crop is disabled

2.0.8

10 Aug 20:37
Compare
Choose a tag to compare

Fixes:

  • Use the current image's width and height (rather than the natural ones) to calculate pixelCrop

2.0.7

08 Aug 17:45
Compare
Choose a tag to compare

Update peer dep to allow React v16

2.0.6 was a mistaken publish (but harmless)

2.0.5

25 May 12:25
Compare
Choose a tag to compare

Fixes:

  • Fix border image not working in Safari #98
  • FixonAspectRatioChange not being called when going from a falsy to truthy value #101

2.0.4

25 May 11:55
Compare
Choose a tag to compare

Additions:

  • Add callbacks onDragStart and onDragEnd #95 #94

Fixes:

  • Use propTypes from prop-types package to fix deprecation warning #97

2.0.3

21 Mar 18:40
Compare
Choose a tag to compare

Updates (Breaking for CSS):

  • Use box-shadow shadow technique of darkening image so that it works on browser like IE11 which didn't support clipPaths

Note: All CSS classes have been renamed from ReactCrop-- to ReactCrop__ so if you were overriding CSS you'll have to adjust your class names.

2.0.2

31 Jan 08:51
Compare
Choose a tag to compare

Fixes:

  • Regression fix: dist/ReactCrop.js went missing from the 2.0.1 release. Note that dist/ is now only included in the npm install.