Package com.twelvemonkeys.contrib.tiff
Class TIFFUtilities
- java.lang.Object
-
- com.twelvemonkeys.contrib.tiff.TIFFUtilities
-
public final class TIFFUtilities extends java.lang.Object
TIFFUtilities for manipulation TIFF Images and Metadata- Version:
- $Id$
- Author:
- Oliver Schmidtmer, last modified by $Author$
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TIFFUtilities.TIFFBaseline
static interface
TIFFUtilities.TIFFExtension
static class
TIFFUtilities.TIFFPage
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.image.BufferedImage
applyOrientation(java.awt.image.BufferedImage input, int orientation)
static java.util.List<TIFFUtilities.TIFFPage>
getPages(javax.imageio.stream.ImageInputStream imageInput)
static void
merge(java.util.List<java.io.File> inputFiles, java.io.File outputFile)
Merges all pages from the input TIFF files into one TIFF file at the output location.static void
rotatePage(javax.imageio.stream.ImageInputStream imageInput, javax.imageio.stream.ImageOutputStream imageOutput, int degree, int pageIndex)
Rotates a page of a TIFF file by changing TIFF.TAG_ORIENTATION.static void
rotatePages(javax.imageio.stream.ImageInputStream imageInput, javax.imageio.stream.ImageOutputStream imageOutput, int degree)
Rotates all pages of a TIFF file by changing TIFF.TAG_ORIENTATION.static java.util.List<java.io.File>
split(java.io.File inputFile, java.io.File outputDirectory)
Splits all pages from the input TIFF file to one file per page in the output directory.static void
writePages(javax.imageio.stream.ImageOutputStream imageOutput, java.util.List<TIFFUtilities.TIFFPage> pages)
-
-
-
Method Detail
-
merge
public static void merge(java.util.List<java.io.File> inputFiles, java.io.File outputFile) throws java.io.IOException
Merges all pages from the input TIFF files into one TIFF file at the output location.- Parameters:
inputFiles
-outputFile
-- Throws:
java.io.IOException
-
split
public static java.util.List<java.io.File> split(java.io.File inputFile, java.io.File outputDirectory) throws java.io.IOException
Splits all pages from the input TIFF file to one file per page in the output directory.- Parameters:
inputFile
-outputDirectory
-- Returns:
- generated files
- Throws:
java.io.IOException
-
rotatePages
public static void rotatePages(javax.imageio.stream.ImageInputStream imageInput, javax.imageio.stream.ImageOutputStream imageOutput, int degree) throws java.io.IOException
Rotates all pages of a TIFF file by changing TIFF.TAG_ORIENTATION.NOTICE: TIFF.TAG_ORIENTATION is an advice how the image is meant do be displayed. Other metadata, such as width and height, relate to the image as how it is stored. The ImageIO TIFF plugin does not handle orientation. Use
applyOrientation(BufferedImage, int)
for applying TIFF.TAG_ORIENTATION.- Parameters:
imageInput
-imageOutput
-degree
- Rotation amount, supports 90�, 180� and 270�.- Throws:
java.io.IOException
-
rotatePage
public static void rotatePage(javax.imageio.stream.ImageInputStream imageInput, javax.imageio.stream.ImageOutputStream imageOutput, int degree, int pageIndex) throws java.io.IOException
Rotates a page of a TIFF file by changing TIFF.TAG_ORIENTATION.NOTICE: TIFF.TAG_ORIENTATION is an advice how the image is meant do be displayed. Other metadata, such as width and height, relate to the image as how it is stored. The ImageIO TIFF plugin does not handle orientation. Use
applyOrientation(BufferedImage, int)
for applying TIFF.TAG_ORIENTATION.- Parameters:
imageInput
-imageOutput
-degree
- Rotation amount, supports 90�, 180� and 270�.pageIndex
- page which should be rotated or -1 for all pages.- Throws:
java.io.IOException
-
getPages
public static java.util.List<TIFFUtilities.TIFFPage> getPages(javax.imageio.stream.ImageInputStream imageInput) throws java.io.IOException
- Throws:
java.io.IOException
-
writePages
public static void writePages(javax.imageio.stream.ImageOutputStream imageOutput, java.util.List<TIFFUtilities.TIFFPage> pages) throws java.io.IOException
- Throws:
java.io.IOException
-
applyOrientation
public static java.awt.image.BufferedImage applyOrientation(java.awt.image.BufferedImage input, int orientation)
-
-