react-image-cropper icon indicating copy to clipboard operation
react-image-cropper copied to clipboard

onImgLoad called before beforeImgLoad when using base64 image data

Open FabriceReynolds opened this issue 8 years ago • 2 comments

The onImgLoad event triggers before beforeImgLoad when the src is set to base64 data. The is probably due to the data already present in memory and firing asynchronously.

FabriceReynolds avatar Apr 27 '17 21:04 FabriceReynolds

Having this issue as well, I used this hack for the time being

handleImageLoad() {
	setTimeout(() => {
		this.avatar.src = this.cropper.crop();
	}, 100);
}

du5rte avatar Nov 14 '17 16:11 du5rte

@FabriceReynolds @du5rte yes, base64 data is already present but beforeImgLoad is fired when component mounted

flyfloor avatar Jan 29 '18 17:01 flyfloor