Using replace() to update image to be cropped in a reactJS component #220
Comments
You must offer a different image URL (or just add a timestamp). If not, the |
hmmm this is strange. because I did offer a different image URL, however, both images are all base64 dataURL. |
I didn't know how the reactJS work, so you may have to fix it by yourself. |
Ok well does your cropper work when I call replace() with base64 encoded data urls ?
|
Yes, URLs, Data URLs and Blob URLs all work. |
Ok I need a little more help in this area. So right now I have the new picture in My cropper is $('#picture'). Now if I do However, if I replace the image with a random image from the internet And finally if I replace the internet image with However it appears I cannot simply add these 2 lines of code in my image updating function:
It does not appear to guarantee that |
In the current version, if you call |
Sorry this is confusing what do you mean? The dataURLs I supplied are both different. But .cropper() thinks they are the same and so they do not replace each other. |
I have a ReactJS component and I handle the initialization, updating and destroying of the cropper tool in ReactJS's lifecycle methods:
componentDidUpdate
,componentDidUnmount
The problem I am facing is when i use
cropper('replace', imageDataURL)
, the editor does not replace the image. It only works when I destroy the cropper and reinitializes it with the new image. However, that leads to terrible lag.The text was updated successfully, but these errors were encountered: