react-image-crop

A responsive image cropping tool for React

ISC License

Downloads
1.8M
Stars
3.8K
Committers
70
react-image-crop - 3.0.7

Published by DominicTobias almost 7 years ago

  • Another non-functional fix to /dist bundles. The minified prod build was in the wrong file so it's now swapped and correct #138
react-image-crop - 3.0.6

Published by DominicTobias almost 7 years ago

  • Fix exception when not passing a crop object into the component (existing since v3.0.0) #132
react-image-crop - 3.0.5

Published by DominicTobias almost 7 years ago

  • Another non-functional release relating to #136, which should satisfy all the ways of consuming the module as UMD (from /dist).
react-image-crop - 3.0.4

Published by DominicTobias almost 7 years ago

  • 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)

react-image-crop - 3.0.3

Published by DominicTobias almost 7 years ago

  • Add back the /dist folder to the repo for CDNs #134

(No functional changes to code)

react-image-crop - 3.0.2

Published by DominicTobias about 7 years ago

  • Pixel crop should be calculated using naturalWidth and naturalHeight #122
react-image-crop - 3.0.1

Published by DominicTobias about 7 years ago

  • Fixed onImageLoaded in the case where the browser has cached the image
react-image-crop - 3.0.0

Published by DominicTobias about 7 years ago

  • 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

react-image-crop - 2.1.1

Published by DominicTobias about 7 years ago

  • Revert HOC refactor as it broke the component due to requiring two non-existent files in dist/
react-image-crop - 2.1.0

Published by DominicTobias about 7 years ago

  • Split component up so it can be used as a HOC
  • Don't render crop handles when crop is disabled
react-image-crop - 2.0.8

Published by DominicTobias about 7 years ago

Fixes:

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

Published by DominicTobias about 7 years ago

Update peer dep to allow React v16

2.0.6 was a mistaken publish (but harmless)

react-image-crop - 2.0.5

Published by DominicTobias over 7 years ago

Fixes:

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

Published by DominicTobias over 7 years ago

Additions:

  • Add callbacks onDragStart and onDragEnd #95 #94

Fixes:

  • Use propTypes from prop-types package to fix deprecation warning #97
react-image-crop - 2.0.3

Published by DominicTobias over 7 years ago

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.

react-image-crop - 2.0.2

Published by DominicTobias over 7 years ago

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.
react-image-crop - 2.0.1

Published by DominicTobias over 7 years ago

Fixes:

  • Hide north, east, south and west ordinate handles on fixed aspect (regression fix)
react-image-crop - 2.0.0

Published by DominicTobias over 7 years ago

Breaking changes:

  • Remove ellipses option
  • No crossorigin default (was "anonymous" which was causing issues #62)

Updates:

  • Change "marching ants" crop selection border animation from animated linear-gradients to a GIF as it was eating lots of CPU #77
react-image-crop - 1.0.4

Published by DominicTobias almost 8 years ago

  • Fix to behaviour when dragging out of crop area for x or y handles #75
  • Added onAspectRatioChange callback #76
react-image-crop - 1.0.3

Published by DominicTobias about 8 years ago

Missing build step for regression fix for crossOrigin tag #68