bamlab/react-native-image-resizer

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

Closed this issue ยท 6 comments

retyui commented

Describe the bug

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

if (rotatedImage != rotatedImage) {
sourceImage.recycle();
}

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

Should it be rotatedImage != sourceImage?

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

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

@retyui

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

thx