Class TIFFUtilities

java.lang.Object
com.twelvemonkeys.contrib.tiff.TIFFUtilities

public final class TIFFUtilities extends Object
TIFFUtilities for manipulation TIFF Images and Metadata
Version:
$Id$
  • Constructor Details

    • TIFFUtilities

      private TIFFUtilities()
  • Method Details

    • merge

      public static void merge(List<File> inputFiles, File outputFile) throws IOException
      Merges all pages from the input TIFF files into one TIFF file at the output location.
      Parameters:
      inputFiles -
      outputFile -
      Throws:
      IOException
    • split

      public static List<File> split(File inputFile, File outputDirectory) throws 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:
      IOException
    • rotatePages

      public static void rotatePages(ImageInputStream imageInput, ImageOutputStream imageOutput, int degree) throws 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:
      IOException
    • rotatePage

      public static void rotatePage(ImageInputStream imageInput, ImageOutputStream imageOutput, int degree, int pageIndex) throws 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:
      IOException
    • getPages

      public static List<TIFFUtilities.TIFFPage> getPages(ImageInputStream imageInput) throws IOException
      Throws:
      IOException
    • writePages

      public static void writePages(ImageOutputStream imageOutput, List<TIFFUtilities.TIFFPage> pages) throws IOException
      Throws:
      IOException
    • applyOrientation

      public static BufferedImage applyOrientation(BufferedImage input, int orientation)