Skip to content

Releases: sekoyo/react-image-crop

3.0.9

10 Jan 17:57
Compare
Choose a tag to compare
  • Add !default to SASS variables to make them overridable #151 #153
  • Fix hard-coded 2px offset on drag handle position calc, so that changing drag-bar size using variables keeps them centred #152

3.0.8

12 Dec 20:19
Compare
Choose a tag to compare

Fixes

  • Ensure wide images work with makeAspectCrop #144

Features

  • Allowed custom styles on image and wrapper elements #141
  • Expose method to contain crop to image boundaries #145

3.0.7

02 Nov 19:22
Compare
Choose a tag to compare
  • Another non-functional fix to /dist bundles. The minified prod build was in the wrong file so it's now swapped and correct #138

3.0.6

01 Nov 17:30
Compare
Choose a tag to compare
  • Fix exception when not passing a crop object into the component (existing since v3.0.0) #132

3.0.5

31 Oct 13:44
Compare
Choose a tag to compare
  • Another non-functional release relating to #136, which should satisfy all the ways of consuming the module as UMD (from /dist).

3.0.4

31 Oct 09:38
Compare
Choose a tag to compare
  • Fixes #136 issue in 3.0.3 which was causing a webpack React vs react casing warning.

Update: This version shouldn't be used when consuming the /dist module (e.g. via a CDN)

3.0.3

30 Oct 18:53
Compare
Choose a tag to compare
  • Add back the /dist folder to the repo for CDNs #134

(No functional changes to code)

3.0.2

10 Oct 10:26
Compare
Choose a tag to compare
  • Pixel crop should be calculated using naturalWidth and naturalHeight #122

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