Open jugalkishors opened 2 years ago
we faced the same issue . We solved it by moving that image to different location with different name using react-native-fs .
I'm having a similar issue but in my case it only happens if I try to crop two (or more) images in a row with little time in between.
I'm making an application where users can select a certain amount of images from the gallery and then they are presented those images one by one so they can crop them or leave them as they are, the thing is that if a user crops two images quickly without waiting any time in between this bug happens
@efstathiosntonas's solution didn't work because this seems to be caused by something else as the filenames i'm getting are not "tempfile.jpg" but "tempfile{some_UUID}.jpg" instead, where the UUID is the same when this bug happens.
I've solved it for now using @AdnanAshraf7's solution by copying the image to a different location inside the onImageCrop callback and using a promise to prevent the user from pressing the button again until this whole process finishes.
It's give me "tempfile.jpg" and i create again a cropped image then new image is replaced with first image due to same name. so how i can change file name of image?