Package com.bumptech.glide.load
Interface ImageHeaderParser
-
- All Known Implementing Classes:
DefaultImageHeaderParser,ExifInterfaceImageHeaderParser
public interface ImageHeaderParserInterface for the ImageHeaderParser.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classImageHeaderParser.ImageTypeThe format of the image data including whether or not the image may include transparent pixels.
-
Field Summary
Fields Modifier and Type Field Description static intUNKNOWN_ORIENTATIONA constant indicating we were unable to parse the orientation from the image either because no exif segment containing orientation data existed, or because of an I/O error attempting to read the exif segment.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetOrientation(java.io.InputStream is, ArrayPool byteArrayPool)Parse the orientation from the image header.intgetOrientation(java.nio.ByteBuffer byteBuffer, ArrayPool byteArrayPool)ImageHeaderParser.ImageTypegetType(java.io.InputStream is)ImageHeaderParser.ImageTypegetType(java.nio.ByteBuffer byteBuffer)
-
-
-
Field Detail
-
UNKNOWN_ORIENTATION
static final int UNKNOWN_ORIENTATION
A constant indicating we were unable to parse the orientation from the image either because no exif segment containing orientation data existed, or because of an I/O error attempting to read the exif segment.- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
@NonNull ImageHeaderParser.ImageType getType(@NonNull java.io.InputStream is) throws java.io.IOException
- Throws:
java.io.IOException
-
getType
@NonNull ImageHeaderParser.ImageType getType(@NonNull java.nio.ByteBuffer byteBuffer) throws java.io.IOException
- Throws:
java.io.IOException
-
getOrientation
int getOrientation(@NonNull java.io.InputStream is, @NonNull ArrayPool byteArrayPool) throws java.io.IOExceptionParse 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.- Returns:
- The exif orientation if present or -1 if the header couldn't be parsed or doesn't contain an orientation
- Throws:
java.io.IOException
-
getOrientation
int getOrientation(@NonNull java.nio.ByteBuffer byteBuffer, @NonNull ArrayPool byteArrayPool) throws java.io.IOException- Throws:
java.io.IOException
-
-