@ VisibleForTesting public static void transcodeJpeg ( final InputStream inputStream , final OutputStream outputStream , final int rotationAngle , 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 . isRotationAngleAllowed ( rotationAngle ) ) ; Preconditions . checkArgument ( scaleNumerator != SCALE_DENOMINATOR || rotationAngle != 0 , "no transformation requested" ) ; nativeTranscodeJpeg ( Preconditions . checkNotNull ( inputStream ) , Preconditions . checkNotNull ( outputStream ) , rotationAngle , scaleNumerator , quality ) ; }
Transcodes an image to match the specified rotation angle and the scale factor .