Package com.twelvemonkeys.contrib.exif
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 Orientation
findImageOrientation
(IIOMetadata metadata) static void
static IIOImage
readWithOrientation
(File input) Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage
.static IIOImage
readWithOrientation
(InputStream input) Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage
.static IIOImage
readWithOrientation
(URL input) Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage
.static IIOImage
Reads 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 returnedIIOImage
will always contain an image and no raster, and theRenderedImage
may be safely cast to aBufferedImage
. If no registeredImageReader
claims to be able to read the input,null
is returned.- Parameters:
input
- aURL
- Returns:
- an
IIOImage
containing 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 returnedIIOImage
will always contain an image and no raster, and theRenderedImage
may be safely cast to aBufferedImage
. If no registeredImageReader
claims to be able to read the input,null
is returned.- Parameters:
input
- anInputStream
- Returns:
- an
IIOImage
containing 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 returnedIIOImage
will always contain an image and no raster, and theRenderedImage
may be safely cast to aBufferedImage
. If no registeredImageReader
claims to be able to read the input,null
is returned.- Parameters:
input
- aFile
- Returns:
- an
IIOImage
containing 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 returnedIIOImage
will always contain an image and no raster, and theRenderedImage
may be safely cast to aBufferedImage
. If no registeredImageReader
claims to be able to read the input,null
is returned.- Parameters:
input
- anImageInputStream
- Returns:
- an
IIOImage
containing the correctly oriented image and metadata including rotation info, ornull
. - Throws:
IOException
- if an error occurs during reading.
-
findImageOrientation
Finds theImageOrientation
tag, if any, and returns anOrientation
based on itsvalue
attribute. If no match is found or the tag is not present,Normal
(the default orientation) is returned.- Parameters:
metadata
- anIIOMetadata
object- Returns:
- the
Orientation
matching thevalue
attribute of theImageOrientation
tag, orNormal
, nevernull
. - See Also:
-
main
- Throws:
IOException
-