public class

JpegTranscoder

extends Object
java.lang.Object
   ↳ com.facebook.imagepipeline.nativecode.JpegTranscoder

Class Overview

Helper methods for modifying jpeg images.

Summary

Constants
int MAX_QUALITY
int MAX_SCALE_NUMERATOR
int MIN_QUALITY
int MIN_SCALE_NUMERATOR
int SCALE_DENOMINATOR
Public Constructors
JpegTranscoder()
Public Methods
static boolean isRotationAngleAllowed(int degrees)
static void transcodeJpeg(InputStream inputStream, OutputStream outputStream, int rotationAngle, int scaleNumerator, int quality)
Downscales and rotates jpeg image
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int MAX_QUALITY

Constant Value: 100 (0x00000064)

public static final int MAX_SCALE_NUMERATOR

Constant Value: 16 (0x00000010)

public static final int MIN_QUALITY

Constant Value: 0 (0x00000000)

public static final int MIN_SCALE_NUMERATOR

Constant Value: 1 (0x00000001)

public static final int SCALE_DENOMINATOR

Constant Value: 8 (0x00000008)

Public Constructors

public JpegTranscoder ()

Public Methods

public static boolean isRotationAngleAllowed (int degrees)

Returns
  • true if and only if given number of degrees is allowed rotation angle, that is it is equal to 0, 90, 180 or 270

public static void transcodeJpeg (InputStream inputStream, OutputStream outputStream, int rotationAngle, int scaleNumerator, int quality)

Downscales and rotates jpeg image

Parameters
rotationAngle 0, 90, 180 or 270
scaleNumerator 1 - 16, image will be scaled using scaleNumerator/8 factor
quality 1 - 100
Throws
IOException