Project Wonder 5.0

er.attachment.thumbnail
Class ImageMagickImageProcessor

java.lang.Object
  extended by er.attachment.thumbnail.ERImageProcessor
      extended by er.attachment.thumbnail.ImageMagickImageProcessor
All Implemented Interfaces:
IERImageProcessor

public class ImageMagickImageProcessor
extends ERImageProcessor

ImageMagickImageProcessor is an implementation of the IImageProcessor interface on top of the ImageMagick commandline tool. You must provide your own installation of ImageMagick, specifically the "convert" and "composite" binaries (along with any dependencies they require).

Author:
mschrag
Properties
er.attachment.ImageProcessor.imageMagickBinFolderer.attachment.ImageProcessor.imageMagickBinFolder
           

Nested Class Summary
 
Nested classes/interfaces inherited from interface er.attachment.thumbnail.IERImageProcessor
IERImageProcessor.Quality
 
Field Summary
 
Fields inherited from class er.attachment.thumbnail.ERImageProcessor
_imageProcessor, log
 
Constructor Summary
ImageMagickImageProcessor(java.io.File imageMagickConvertBinary, java.io.File imageMagickCompositeBinary)
          Constructs a new ImageMagickImageProcessor using a max memory setting of 128M.
ImageMagickImageProcessor(java.io.File imageMagickConvertBinary, java.io.File imageMagickCompositeBinary, long maxMemory)
          Constructs a new ImageMagickImageProcessor.
 
Method Summary
static IERImageProcessor imageMagickImageProcessor()
          Returns an ImageMagick image processor.
 void processImage(int resizeWidth, int resizeHeight, IERImageProcessor.Quality resizeQuality, int dpi, float sharpenRadius, float sharpenIntensity, float gamma, int cropX, int cropY, int cropWidth, int cropHeight, java.io.File watermarkFile, boolean tileWatermark, float compressionQuality, java.io.File colorProfileFile, java.io.File inputFile, java.io.File outputFile, ERMimeType outputMimeType)
          Processes the given image with all of the given configuration settings.
 
Methods inherited from class er.attachment.thumbnail.ERImageProcessor
imageProcessor, thumbnail, thumbnail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageMagickImageProcessor

public ImageMagickImageProcessor(java.io.File imageMagickConvertBinary,
                                 java.io.File imageMagickCompositeBinary)
Constructs a new ImageMagickImageProcessor using a max memory setting of 128M.

Parameters:
imageMagickConvertBinary - the "convert" binary path
imageMagickCompositeBinary - the "composite" binary path

ImageMagickImageProcessor

public ImageMagickImageProcessor(java.io.File imageMagickConvertBinary,
                                 java.io.File imageMagickCompositeBinary,
                                 long maxMemory)
Constructs a new ImageMagickImageProcessor.

Parameters:
imageMagickConvertBinary - the "convert" binary path
imageMagickCompositeBinary - the "composite" binary path
maxMemory - the memory limit in bytes
Method Detail

processImage

public void processImage(int resizeWidth,
                         int resizeHeight,
                         IERImageProcessor.Quality resizeQuality,
                         int dpi,
                         float sharpenRadius,
                         float sharpenIntensity,
                         float gamma,
                         int cropX,
                         int cropY,
                         int cropWidth,
                         int cropHeight,
                         java.io.File watermarkFile,
                         boolean tileWatermark,
                         float compressionQuality,
                         java.io.File colorProfileFile,
                         java.io.File inputFile,
                         java.io.File outputFile,
                         ERMimeType outputMimeType)
                  throws java.io.IOException
Description copied from interface: IERImageProcessor
Processes the given image with all of the given configuration settings. Order: resize/dpi, colorspace, crop, sharpen, gamma, watermark

Parameters:
resizeWidth - the maximum width to resize to (or -1 to not specify)
resizeHeight - the maximum height to resize to (or -1 to not specify)
resizeQuality - influences the resize algorithm to use (or null to not specify)
dpi - the dpi to resize to (or -1 to skip)
sharpenRadius - the radius of the unsharp mask (or <= 0.0 to skip)
sharpenIntensity - the intensity of the unsharp mask (or <= 0.0 to skip)
gamma - the gamma to apply (or 0.0 to skip)
cropX - the x position of the crop (or <= 0 to skip)
cropY - the y position of the crop (or <= 0 to skip)
cropWidth - the width of the crop (or <= 0 to skip)
cropHeight - the height of the crop (or <= 0 to skip)
watermarkFile - the watermark File to apply to this image (or null to skip)
tileWatermark - whether or not to tile the watermark
compressionQuality - the compression quality of the resize to perform (0.0 to ignore) -- range is 0.0 to 1.0 (1.0 = best)
colorProfileFile - the ICC profile to use (or null to skip)
inputFile - the File to perform the given operations on
outputFile - the File to write the resulting output image to
outputMimeType - the desired mime type of the output file
Throws:
java.io.IOException - if the image processing fails

imageMagickImageProcessor

public static IERImageProcessor imageMagickImageProcessor()
                                                   throws java.io.IOException
Returns an ImageMagick image processor.

Returns:
an ImageMagick image processor
Throws:
java.io.IOException - if an ImageMagick cannot be created
Properties
er.attachment.ImageProcessor.imageMagickBinFolder the ImageMagick bin folder
           

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.