Class EXIFUtilities
java.lang.Object
com.twelvemonkeys.contrib.exif.EXIFUtilities
EXIFUtilities.
- Version:
- : EXIFUtilities.java,v 1.0 23/06/2020
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OrientationfindImageOrientation(IIOMetadata metadata) static voidstatic IIOImagereadWithOrientation(File input) Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage.static IIOImagereadWithOrientation(InputStream input) Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage.static IIOImagereadWithOrientation(URL input) Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage.static IIOImageReads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage.
-
Constructor Details
-
EXIFUtilities
public EXIFUtilities()
-
-
Method Details
-
readWithOrientation
Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage. The returnedIIOImagewill always contain an image and no raster, and theRenderedImagemay be safely cast to aBufferedImage. If no registeredImageReaderclaims to be able to read the input,nullis returned.- Parameters:
input- aURL- Returns:
- an
IIOImagecontaining the correctly oriented image and metadata including rotation info, ornull. - Throws:
IOException- if an error occurs during reading.
-
readWithOrientation
Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage. The returnedIIOImagewill always contain an image and no raster, and theRenderedImagemay be safely cast to aBufferedImage. If no registeredImageReaderclaims to be able to read the input,nullis returned.- Parameters:
input- anInputStream- Returns:
- an
IIOImagecontaining the correctly oriented image and metadata including rotation info, ornull. - Throws:
IOException- if an error occurs during reading.
-
readWithOrientation
Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage. The returnedIIOImagewill always contain an image and no raster, and theRenderedImagemay be safely cast to aBufferedImage. If no registeredImageReaderclaims to be able to read the input,nullis returned.- Parameters:
input- aFile- Returns:
- an
IIOImagecontaining the correctly oriented image and metadata including rotation info ornull. - Throws:
IOException- if an error occurs during reading.
-
readWithOrientation
Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage. The returnedIIOImagewill always contain an image and no raster, and theRenderedImagemay be safely cast to aBufferedImage. If no registeredImageReaderclaims to be able to read the input,nullis returned.- Parameters:
input- anImageInputStream- Returns:
- an
IIOImagecontaining the correctly oriented image and metadata including rotation info, ornull. - Throws:
IOException- if an error occurs during reading.
-
findImageOrientation
Finds theImageOrientationtag, if any, and returns anOrientationbased on itsvalueattribute. If no match is found or the tag is not present,Normal(the default orientation) is returned.- Parameters:
metadata- anIIOMetadataobject- Returns:
- the
Orientationmatching thevalueattribute of theImageOrientationtag, orNormal, nevernull. - See Also:
-
main
- Throws:
IOException
-