hhunaid / react-native-image-crop-tools

Native-ish Image Crop Tools for react native
171 stars 58 forks source link

Image saves with the same name #62

Closed abdul-rafeh closed 2 years ago

abdul-rafeh commented 2 years ago

Image is saved with the same name hence it is always picking the initial image after cropping

QasimJaffry commented 2 years ago

same here... anyone?

AdnanAshraf7 commented 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 .

efstathiosntonas commented 2 years ago

Found the issue in this line: https://github.com/hhunaid/react-native-image-crop-tools/blob/2a2c453e6c24f9bb5c1736db45d092cad939601e/android/src/main/java/com/parsempo/ImageCropTools/ImageCropViewManager.kt#L35

it should be

 map.putString("uri", result.getUriFilePath(reactContext, true).toString())

but beware because the canhub cropper states on function's doc:

 /**
         * The file path of the image to load
         * Null if get cropped image was executed, no output requested or failure.
         *
         * @param uniqueName If true, make each image cropped have a different file name, this could
         * cause memory issues, use wisely. [Default: false]
*/

I won't submit a PR, @hhunaid has not merged my previous ones with the serious bug on ios image rotation so I won't bother creating a new one.

hhunaid commented 2 years ago

@efstathiosntonas I have more or less abandoned the project because I no longer work with React Native. Sorry you felt it was personal. PRs take some time to review which I simply did not have. That said I have merged your changes now.

efstathiosntonas commented 2 years ago

@hhunaid no worries, sorry if I sounded aggressive! Do you want to make me a collaborator to help on my free time?

geakk commented 2 years ago

Would be very cool if @efstathiosntonas could be a collaborator! I have seen how invested he is in the project and it would be sad this cool library goes to waste.

hhunaid commented 2 years ago

Are you still interested @efstathiosntonas ?

efstathiosntonas commented 2 years ago

@hhunaid sure, just add me as a collaborator. I’ll try to keep it up.

geakk commented 2 years ago

Glad to hear this @hhunaid !!!

@efstathiosntonas Did you have a fix for this issue ? I am trying to make it work on Android and it does not seem to work out!

efstathiosntonas commented 2 years ago

@geakk this should be fixed on 1.6.2, have you tried it out?

geakk commented 2 years ago

Yes, I am using 1.6.2... strange "react-native-image-crop-tools": "^1.6.2"

geakk commented 2 years ago

Basically, I can open the modal and use the ui to crop the image, but I can't seem to be able to 'confirm' the crop and get the new image.

Tried debugging but onImageCrop is not returning anything on Android. Haven't tried on iOS yet.