private static TriState shouldTransform(
      ImageRequest request, EncodedImage encodedImage, ImageTranscoder imageTranscoder) {
    if (encodedImage == null || encodedImage.getImageFormat() == ImageFormat.UNKNOWN) {
      return TriState.UNSET;
    }

    if (!imageTranscoder.canTranscode(encodedImage.getImageFormat())) {
      return TriState.NO;
    }

    return TriState.valueOf(
        shouldRotate(request.getRotationOptions(), encodedImage)
            || imageTranscoder.canResize(
                encodedImage, request.getRotationOptions(), request.getResizeOptions())
            || imageTranscoder.canTransformAVIF(encodedImage.getImageFormat()));
  }
Resizes and rotates images according to the EXIF orientation data or a specified rotation angle.

<p>If the image is not supported by the {@link ImageTranscoder}, no transformation is applied.

<p>This can be used even if downsampling is enabled as long as resizing is disabled.
imagepipeline/src/main/java/com/facebook/imagepipeline/producers/ResizeAndRotateProducer.java