NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm
A React component to crop images/videos with easy interactions
Latest stable
6.2.5
Last release 16 days ago
09 Nov 2026
Release timing varies
gaps range from 9 days to 4 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
195 releases · first in 2018
Drag across the ruler to compare, or tap a release to open it.
Nothing published for this version
Add requireCtrlKey & requireMultiTouch props by @MatixYo in https://github.com/ValentinH/react-easy-crop/pull/357
Full Changelog: https://github.com/ValentinH/react-easy-crop/compare/v4.0.3...v4.1.0
chore: export LICENSE in package 3ea08ef
https://github.com/ValentinH/react-easy-crop/compare/v4.0.2...v4.0.3
Full Changelog: https://github.com/ValentinH/react-easy-crop/compare/v4.0.2...v4.0.3
Your coding agent can read these notes before it upgrades. Set up the MCP server →
docs: add trurl-master as a contributor for code, example by @allcontributors in https://github.com/ValentinH/react-easy-crop/pull/324
Full Changelog: https://github.com/ValentinH/react-easy-crop/compare/v4.0.1...v4.0.2
[CI] Split different tests to have better reporting by @raed667 in https://github.com/ricardo-ch/react-easy-crop/pull/317
Full Changelog: https://github.com/ricardo-ch/react-easy-crop/compare/v4.0.0...v4.0.1
TL;DR: If you were not using the rotation prop, there should be no breaking changes.
Thanks to an awesome work by @trurl-master, we are now handling rotation properly when computing the output image coordinate. 🎉 in addition, the example code for generating the cropped image is now more efficient and should reduce the number of issues on iOS devices like reported in #91.
initialCroppedAreaPercentages is similar to initialCroppedAreaPixels but more accurate as there is no rounding.
It minimizes the losses of save/restore operations. They're still present on some occasions as the JS floating-point operations accuracy is limited, but it allows to preserve the crop for much longer. initialCroppedAreaPixels still can be used, but it's a bit risky.
TL;DR: If you were not using the rotation prop, there should be no breaking changes.
The croppedArea and croppedAreaPixels output by onCropComplete() have changed when using the Cropper with a rotation different than 0.
The main impact this major version has is on the croppedAreaPixels when used together with the rotation. As it now generates bounding box relative values, you will need to remake the part that generates the final image, taking that into account.
Here's an example implementation (codesandbox):
First, calculate the bounding box size:
const image = await createImage(...)
const rotRad = getRadianAngle(rotation)
const bBoxWidth =
Math.abs(Math.cos(rotRad) * image.width) +
Math.abs(Math.sin(rotRad) * image.height)
const bBoxHeight =
Math.abs(Math.sin(rotRad) * image.width) +
Math.abs(Math.cos(rotRad) * image.height)
Second, create a canvas element with the size of the bounding box:
const canvas = document.createElement('canvas')
canvas.width = bBoxWidth
canvas.height = bBoxHeight
Then, rotate the canvas context around the center of the canvas:
const ctx = canvas.getContext('2d')
ctx.translate(bBoxWidth / 2, bBoxHeight / 2)
ctx.rotate(rotRad)
Set context to point to the top-left corner of the rotated image:
ctx.translate(-image.width / 2, -image.height / 2)
Draw the image onto the rotated context:
ctx.drawImage(image, 0, 0)
What you have in the canvas at this point is a rotated image inside its bounding box. Now, you just need to extract the result using croppedAreaPixels and repaint it on a canvas with the size of the final image:
const data = ctx.getImageData(
croppedAreaPixels.x,
croppedAreaPixels.y,
croppedAreaPixels.width,
croppedAreaPixels.height
)
// set the canvas size to the final image size - this will clear existing context
canvas.width = croppedAreaPixels.width
canvas.height = croppedAreaPixels.height
// paste the extracted image at the top left corner
ctx.putImageData(data, 0, 0)
croppedAreaIf you somehow managed to use croppedArea with rotation before - you're smarter than me. If not - now is the time. The approach is basically the same as with croppedAreaPixels - you just need to convert percentages to pixels based on the image you're cropping
Here's how you can use percentages server-side and crop using sharp (codesandbox):
Rotate the image:
const image = sharp(...);
await image.rotate(rotation);
Get rotated image bounding box size (basically you need to create a new image out of the rotated one, otherwise the metadata won't change):
const meta = await sharp(await image.toBuffer()).metadata();
Alternatively, you can calculate the bounding box size using the same method we used for the client-side crop
Convert percentages to pixels:
const cropInfo = {
top: Math.round((croppedArea.y / 100) * meta.height),
left: Math.round((croppedArea.x / 100) * meta.width),
width: Math.round((croppedArea.width / 100) * meta.width),
height: Math.round((croppedArea.height / 100) * meta.height)
}
Extract the image:
const myCroppedImage = await image.extract(cropInfo)
Full Changelog: https://github.com/ricardo-ch/react-easy-crop/compare/v3.5.3...v4.0.0
Nothing published for this version
Remove useless preventDefault() e2d3581
https://github.com/ricardo-ch/react-easy-crop/compare/v3.5.2...v3.5.3
Refresh video source on component update (#274) ab0ec17
https://github.com/ricardo-ch/react-easy-crop/compare/v3.5.1...v3.5.2
Add key prop to video source (#260) 102af97
https://github.com/ricardo-ch/react-easy-crop/compare/v3.5.0...v3.5.1
Allow multiple sources for video (#258) aa808fa
https://github.com/ricardo-ch/react-easy-crop/compare/v3.4.0...v3.5.0
A new property objectFit is here to let the developer choose how the image/video is adjusted to the parent container.
A new property objectFit is here to let the developer choose how the image/video is adjusted to the parent container.
Possible values are:
contain: the image will be adjusted to be fully visiblehorizontal-cover: the image will horizontally fill the croppervertical-cover: the image will vertically fill the cropper.Defaults to "contain" (original behavior).
https://github.com/ricardo-ch/react-easy-crop/compare/v3.3.3...v3.4.0
Add Typescript example and use hook for demo b9c18f9
https://github.com/ricardo-ch/react-easy-crop/compare/v3.3.2...v3.3.3
Fix: use IE11-compatible way of removing stylesheet 7712fea
https://github.com/ricardo-ch/react-easy-crop/compare/v3.3.1...v3.3.2
Use normalize-wheel to fix zoom with scroll on Firefox 44b42d6
https://github.com/ricardo-ch/react-easy-crop/compare/v3.3.0...v3.3.1
Introduce onCropAreaChange property (#188) c45726b
https://github.com/ricardo-ch/react-easy-crop/compare/v3.2.2...v3.3.0
Added Docker Hub Auth to CircleCI Configuration (#184) 229bbef
https://github.com/ricardo-ch/react-easy-crop/compare/v3.2.1...v3.2.2
Export props to allow other libraries to reference it (#181) 4e49d41
https://github.com/ricardo-ch/react-easy-crop/compare/v3.2.0...v3.2.1
Introduce a new onCropSizeChange prop. It's called when a change in either the cropSize width or the cropSize height occurs.
onCropSizeChange prop. It's called when a change in either the cropSize width or the cropSize height occurs.https://github.com/ricardo-ch/react-easy-crop/compare/v3.1.1...v3.2.0
fix(crop size): handle vertical ratio properly (#157) be396bb
https://github.com/ricardo-ch/react-easy-crop/compare/v3.1.0...v3.1.1
Transform prop and flip demo (#150) 0c36b83
https://github.com/ricardo-ch/react-easy-crop/compare/v3.0.1...v3.1.0
docs: add dvail as a contributor (#135) dcca9d5
https://github.com/ricardo-ch/react-easy-crop/compare/v3.0.0...v3.0.1
Thanks to @stefanoruth in #127, we have remove the dependency on @emotion to manage the styles. This decreased the gzipped size from 12.5KB to 4KB 😱
Thanks to @stefanoruth in #127, we have remove the dependency on @emotion to manage the styles. This decreased the gzipped size from 12.5KB to 4KB 😱
If you were using the classnames property, you might have to manually import the CSS file starting from 3.0.0. See https://github.com/ricardo-ch/react-easy-crop#styles
Except for this, everything should be the same 🙂
https://github.com/ricardo-ch/react-easy-crop/compare/v2.1.2...v3.0.0
Update rollup-plugin-typescript2 #129
docs: add FillPower1 as a contributor (#110) d4dd8bc
https://github.com/ricardo-ch/react-easy-crop/compare/v2.1.0...v2.1.1
Add zoomWithScroll prop for prevent scrolling & update README (#100) a180f57
https://github.com/ricardo-ch/react-easy-crop/compare/v2.0.1...v2.1.0
fix README props table (#89) 3134173
https://github.com/ricardo-ch/react-easy-crop/compare/v2.0.0...v2.0.1
We have removed all the deprecated props and some other props that were actually useless.
The library has been rewritten to Typescript and now ships its own definitions.
We have removed all the deprecated props and some other props that were actually useless.
Here are the (few) migration steps:
crossOrigin was removed: you can directly pass the crossOrigin attribute to the mediaProps property.onImgError and onMediaError were removed: you can directly pass the onError callback to the mediaProps property.onImageLoaded was removed: you should now use the onMediaLoaded propertyhttps://github.com/ricardo-ch/react-easy-crop/compare/v1.17.1...v2.0.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Do nothing in setNewZoom when onZoomChange is not set a45b021
https://github.com/ricardo-ch/react-easy-crop/compare/v1.17.0...v1.17.1
Added possibility to use with videos (#77) 77fb4a7
https://github.com/ricardo-ch/react-easy-crop/compare/v1.16.2...v1.17.0
fix: support cropSize with initialCroppedAreaPixels (#74) eef7a80
https://github.com/ricardo-ch/react-easy-crop/compare/v1.16.1...v1.16.2
Fix croppedArea output when image is rotated (#63) 6247079
https://github.com/ricardo-ch/react-easy-crop/compare/v1.16.0...v1.16.1
feat: add onImageLoaded callback (#62) 64ee690
onImageLoaded callback (#62) 64ee690https://github.com/ricardo-ch/react-easy-crop/compare/v1.15.0...v1.16.0
Constrain image when rotated (#53) 0d9efb0
https://github.com/ricardo-ch/react-easy-crop/compare/v1.14.0...v1.15.0
Add support for rotation prop 5b2713d
https://github.com/ricardo-ch/react-easy-crop/compare/v1.13.1...v1.14.0
Prevent zooming/moving when picture is loading (#46) bfa2d45
https://github.com/ricardo-ch/react-easy-crop/compare/v1.13.0...v1.13.1
added onInteractionBegan callback to onWheel and onDrag (#42) 0327a71
https://github.com/ricardo-ch/react-easy-crop/compare/v1.12.0...v1.13.0
Add support for initialCroppedAreaPixels (#37) d75d0f9
https://github.com/ricardo-ch/react-easy-crop/compare/v1.11.1...v1.12.0
Nothing published for this version
Don't restrict croppedArea when restrictPosition is false (#35) ec2ea77
https://github.com/ricardo-ch/react-easy-crop/compare/v1.11.0...v1.11.1
Nothing published for this version
Add restrictPosition prop (#32) d9c3430
https://github.com/ricardo-ch/react-easy-crop/compare/v1.10.0...v1.11.0
Add a new cropSize option 21c30fb
cropSize option 21c30fbhttps://github.com/ricardo-ch/react-easy-crop/compare/v1.9.2...v1.10.0
Nothing published for this version
Ensure we init properly when the image onLoad is not called automatically d48a68a
https://github.com/ricardo-ch/react-easy-crop/compare/v1.9.1...v1.9.2
Nothing published for this version
Force the wheel event to not be passive 4cca250
https://github.com/ricardo-ch/react-easy-crop/compare/v1.9.0...v1.9.1
Make croppedAreaPixels more accurate and rounded (values are now integers) (#28) 744b795
croppedAreaPixels more accurate and rounded (values are now integers) (#28) 744b795https://github.com/ricardo-ch/react-easy-crop/compare/v1.8.3...v1.9.0
Nothing published for this version
Remove babel-plugin-emotion which was generating wrong deps 0f5664a
https://github.com/ricardo-ch/react-easy-crop/compare/v1.8.2...v1.8.3
Update dependencies (#25) 2fd7475
https://github.com/ricardo-ch/react-easy-crop/compare/v1.8.1...v1.8.2
Disable page scrolling on iOS when user scrolls inside of crop component
Add a crossOrigin pass-through property
Add zoomSpeed prop to customize zoom by scroll speed
add support for custom style and classes
onImgError property to handle image error (#18)One column per quarter.