bamlab / react-native-image-resizer

🗻 Resize local images with React Native
MIT License
1.59k stars 338 forks source link

Isn't `rotatedImage != rotatedImage` always true? #394

Closed retyui closed 2 months ago

retyui commented 6 months ago

Describe the bug

Hi bam engineers. can you explain how the next line should works

https://github.com/bamlab/react-native-image-resizer/blob/96721a2c346c3254e28bf48e81cd4ed7815d24e3/android/src/main/java/com/reactnativeimageresizer/ImageResizer.java#L560-L562

macksal commented 6 months ago

As an optimisation, it could be possible for rotateImage() to return the same Bitmap when rotation=0.

0xc22b commented 4 months ago

Should it be rotatedImage != sourceImage?

macksal commented 4 months ago

ha, you're right. I wonder if there's a memory leak because of this? Not sure if Bitmap.recycle is necessary to call or if it can still be GC'd

taboulot commented 3 months ago

Hey ! Indeed I think it's not normal. Will be fixed in this PR once merged : #398

taboulot commented 2 months ago

@retyui

I close this issue has it must be fixed in 3.0.10.

retyui commented 2 months ago

thx