react-native-image-crop-tools
react-native-image-crop-tools copied to clipboard
In Android, it gives same file name of multiple images when it create cropped image.
It's give me "temp_file_.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?
we faced the same issue . We solved it by moving that image to different location with different name using react-native-fs .
solution here: https://github.com/hhunaid/react-native-image-crop-tools/issues/62#issuecomment-1054039871
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 "temp_file_.jpg" but "temp_file_{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.