Class DefaultImageHeaderParser
java.lang.Object
com.bumptech.glide.load.resource.bitmap.DefaultImageHeaderParser
- All Implemented Interfaces:
ImageHeaderParser
A class for parsing the exif orientation and other data from an image header.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.bumptech.glide.load.ImageHeaderParser
ImageHeaderParser.ImageType -
Field Summary
Fields inherited from interface com.bumptech.glide.load.ImageHeaderParser
UNKNOWN_ORIENTATION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetOrientation(InputStream is, ArrayPool byteArrayPool) Parse the orientation from the image header.intgetOrientation(ByteBuffer byteBuffer, ArrayPool byteArrayPool) getType(InputStream is) getType(ByteBuffer byteBuffer)
-
Constructor Details
-
DefaultImageHeaderParser
public DefaultImageHeaderParser()
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceImageHeaderParser- Throws:
IOException
-
getType
@NonNull public ImageHeaderParser.ImageType getType(@NonNull ByteBuffer byteBuffer) throws IOException - Specified by:
getTypein interfaceImageHeaderParser- Throws:
IOException
-
getOrientation
public int getOrientation(@NonNull InputStream is, @NonNull ArrayPool byteArrayPool) throws IOException Description copied from interface:ImageHeaderParserParse the orientation from the image header. If it doesn't handle this image type (or this is not an image) it will return a default value rather than throwing an exception.- Specified by:
getOrientationin interfaceImageHeaderParser- Returns:
- The exif orientation if present or -1 if the header couldn't be parsed or doesn't contain an orientation
- Throws:
IOException
-
getOrientation
public int getOrientation(@NonNull ByteBuffer byteBuffer, @NonNull ArrayPool byteArrayPool) throws IOException - Specified by:
getOrientationin interfaceImageHeaderParser- Throws:
IOException
-