question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Explodes when image loads when crop={ undefined } (before onChange fires)

See original GitHub issue

This is a regression since 3.0.11, and exists in 4.0.1—4.0.4:

  • While you can initially omit the crop object, any subsequent change will need to be saved to state in the onChange callback and passed here.

Initially we pass crop={ undefined }, and update crop= only after onChange fires. Since at least 4.0.1, react-image-crop will crash in onImageLoad’s call of getPixelCrop(image, this.props.crop), because at image load time this.props.crop is still undefined (because we haven’t fired onChange yet with that value)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
DominicTobiascommented, Sep 10, 2018

Fixed in 5.0.0. Please try it out and let me know if you have any issues.

0reactions
grrowlcommented, Sep 26, 2018

sorry we haven’t had a chance to bump it internally yet! thanks for your help 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Image fires onload event, but image is still undefined
i inside the event handlers are always equal to imageArray.length - 1 , because i increases during the loop.
Read more >
imagepng - Manual - PHP
this file opens a picture from $imagepath and returns it as a valid picture to embed in: <img src="file.php?image=123.jpg[?maxX=200&maxY=150]"> (in ...
Read more >
ZIM Docs - Text Version - ZIMjs
There may be a security error when loading images locally for any Canvas app. Please read https://zimjs.com/tips.html#IMAGES for easy solutions. Before ZIM ...
Read more >
Firescope Home
The following CDF memo outlines the Southern California firefight that occurred during late September and early October 1970. This Santa Ana wind event...
Read more >
FAQs • Loudoun County, VA • CivicEngage
4. I am on the third priority list (lives in Loudoun County/works outside Loudoun County), but if my new job is located in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found