Package com.twelvemonkeys.contrib.exif
Class EXIFUtilities
- java.lang.Object
-
- com.twelvemonkeys.contrib.exif.EXIFUtilities
-
public class EXIFUtilities extends java.lang.Object
EXIFUtilities.- Version:
- : EXIFUtilities.java,v 1.0 23/06/2020
- Author:
- Harald Kuhr
-
-
Constructor Summary
Constructors Constructor Description EXIFUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Orientation
findImageOrientation(javax.imageio.metadata.IIOMetadata metadata)
static void
main(java.lang.String[] args)
static javax.imageio.IIOImage
readWithOrientation(java.io.File input)
Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage
.static javax.imageio.IIOImage
readWithOrientation(java.io.InputStream input)
Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage
.static javax.imageio.IIOImage
readWithOrientation(java.net.URL input)
Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage
.static javax.imageio.IIOImage
readWithOrientation(javax.imageio.stream.ImageInputStream input)
Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage
.
-
-
-
Method Detail
-
readWithOrientation
public static javax.imageio.IIOImage readWithOrientation(java.net.URL input) throws java.io.IOException
Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage
.- Parameters:
input
- aURL
- Returns:
- an
IIOImage
containing the correctly oriented image and metadata including rotation info. - Throws:
java.io.IOException
- if an error occurs during reading.
-
readWithOrientation
public static javax.imageio.IIOImage readWithOrientation(java.io.InputStream input) throws java.io.IOException
Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage
.- Parameters:
input
- anInputStream
- Returns:
- an
IIOImage
containing the correctly oriented image and metadata including rotation info. - Throws:
java.io.IOException
- if an error occurs during reading.
-
readWithOrientation
public static javax.imageio.IIOImage readWithOrientation(java.io.File input) throws java.io.IOException
Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage
.- Parameters:
input
- aFile
- Returns:
- an
IIOImage
containing the correctly oriented image and metadata including rotation info. - Throws:
java.io.IOException
- if an error occurs during reading.
-
readWithOrientation
public static javax.imageio.IIOImage readWithOrientation(javax.imageio.stream.ImageInputStream input) throws java.io.IOException
Reads image and metadata, applies Exif orientation to image, and returns everything as anIIOImage
.- Parameters:
input
- anImageInputStream
- Returns:
- an
IIOImage
containing the correctly oriented image and metadata including rotation info. - Throws:
java.io.IOException
- if an error occurs during reading.
-
findImageOrientation
public static Orientation findImageOrientation(javax.imageio.metadata.IIOMetadata metadata)
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:
Orientation
, Standard (Plug-in Neutral) Metadata Format Specification
-
main
public static void main(java.lang.String[] args) throws java.io.IOException
- Throws:
java.io.IOException
-
-