Fix NPE when RotationOptions.disableRotation()
Summary:
ResizeAndRotateProducer closes the encoded image when using RotationOptions.disableRotation()
This causes crash when using the same image with different configuration e.g. EncodedMemoryCacheProducer closes the encoded image anyway.
@@ -207,7 +207,6 @@ public class ResizeAndRotateProducer implements Producer<EncodedImage> {
private @Nullable EncodedImage getCloneWithRotationApplied(
EncodedImage encodedImage, int angle) {
EncodedImage newResult = EncodedImage.cloneOrNull(encodedImage); // for thread-safety sake
- encodedImage.close();
if (newResult != null) {
newResult.setRotationAngle(angle);
}
