to.etc.domui.util.images.machines
Class ImageMagicImageHandler

java.lang.Object
  extended by to.etc.domui.util.images.machines.ImageMagicImageHandler
All Implemented Interfaces:
ImageHandler

public final class ImageMagicImageHandler
extends java.lang.Object
implements ImageHandler


Field Summary
static java.lang.String GIF
           
static java.lang.String JPEG
           
static java.lang.String JPG
           
static java.lang.String PNG
           
 
Method Summary
static ImageMagicImageHandler getInstance()
          This returns the ImageMagic manipulator *if* it is available.
 ImageInfo identify(java.io.File input)
          Runs the "identify" call and returns per-page info.
 ImageSpec scale(ImageConverterHelper h, ImageSpec source, int page, int width, int height, java.lang.String targetMime)
           
 ImageSpec thumbnail(ImageConverterHelper h, ImageSpec source, int page, int width, int height, java.lang.String targetMime)
          Create a thumbnail from a source image spec.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PNG

public static final java.lang.String PNG
See Also:
Constant Field Values

JPEG

public static final java.lang.String JPEG
See Also:
Constant Field Values

JPG

public static final java.lang.String JPG
See Also:
Constant Field Values

GIF

public static final java.lang.String GIF
See Also:
Constant Field Values
Method Detail

getInstance

public static ImageMagicImageHandler getInstance()
This returns the ImageMagic manipulator *if* it is available. If ImageMagic is not available then this returns null.

Returns:

identify

public ImageInfo identify(java.io.File input)
                   throws java.lang.Exception
Runs the "identify" call and returns per-page info.

Specified by:
identify in interface ImageHandler
Parameters:
input -
Returns:
Throws:
java.lang.Exception

thumbnail

public ImageSpec thumbnail(ImageConverterHelper h,
                           ImageSpec source,
                           int page,
                           int width,
                           int height,
                           java.lang.String targetMime)
                    throws java.lang.Exception
Create a thumbnail from a source image spec.

Specified by:
thumbnail in interface ImageHandler
Parameters:
source -
Returns:
Throws:
java.lang.Exception

scale

public ImageSpec scale(ImageConverterHelper h,
                       ImageSpec source,
                       int page,
                       int width,
                       int height,
                       java.lang.String targetMime)
                throws java.lang.Exception
Specified by:
scale in interface ImageHandler
Throws:
java.lang.Exception