@ VisibleForTesting public static void transcodeJpegWithExifOrientation ( final InputStream inputStream , final OutputStream outputStream , final int exifOrientation , final int scaleNumerator , final int quality ) throws IOException { NativeJpegTranscoderSoLoader . ensure ( ) ; Preconditions . checkArgument ( scaleNumerator >= MIN_SCALE_NUMERATOR ) ; Preconditions . checkArgument ( scaleNumerator <= MAX_SCALE_NUMERATOR ) ; Preconditions . checkArgument ( quality >= MIN_QUALITY ) ; Preconditions . checkArgument ( quality <= MAX_QUALITY ) ; Preconditions . checkArgument ( JpegTranscoderUtils . isExifOrientationAllowed ( exifOrientation ) ) ; Preconditions . checkArgument ( scaleNumerator != SCALE_DENOMINATOR || exifOrientation != ExifInterface . ORIENTATION_NORMAL , "no transformation requested" ) ; nativeTranscodeJpegWithExifOrientation ( Preconditions . checkNotNull ( inputStream ) , Preconditions . checkNotNull ( outputStream ) , exifOrientation , scaleNumerator , quality ) ; }
Transcodes an image to match the specified exif orientation and the scale factor .