com.bumptech.glide.load.resource.bitmap
Class ImageHeaderParser

java.lang.Object
  extended by com.bumptech.glide.load.resource.bitmap.ImageHeaderParser

public class ImageHeaderParser
extends Object

A class for parsing the exif orientation and other data from an image header.


Nested Class Summary
static class ImageHeaderParser.ImageType
          The format of the image data including whether or not the image may include transparent pixels.
 
Constructor Summary
ImageHeaderParser(InputStream is)
           
 
Method Summary
 int getOrientation()
          Parse the orientation from the image header.
 ImageHeaderParser.ImageType getType()
           
 boolean hasAlpha()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageHeaderParser

public ImageHeaderParser(InputStream is)
Method Detail

hasAlpha

public boolean hasAlpha()
                 throws IOException
Throws:
IOException

getType

public ImageHeaderParser.ImageType getType()
                                    throws IOException
Throws:
IOException

getOrientation

public int getOrientation()
                   throws IOException
Parse 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:
IOException