fr.paris.lutece.plugins.stock.utils
Class ImageUtils

java.lang.Object
  extended by fr.paris.lutece.plugins.stock.utils.ImageUtils

public final class ImageUtils
extends Object

Class for manipulating images

Author:
abataille

Method Summary
static File createThumbnail(File fImage, int width, int height)
          Create a thumbnail and write it into a new file prefixed by tb_ (images/lutece.jpg => images/lutece_tb.jpg)
static File resizeImage(File fImage, int maxWidth, int maxHeight, String newName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createThumbnail

public static File createThumbnail(File fImage,
                                   int width,
                                   int height)
                            throws IOException
Create a thumbnail and write it into a new file prefixed by tb_ (images/lutece.jpg => images/lutece_tb.jpg)

Parameters:
fImage - source image file
width - max width of the thumbnail
height - the height
Throws:
IOException - Signals that an I/O exception has occurred.

resizeImage

public static File resizeImage(File fImage,
                               int maxWidth,
                               int maxHeight,
                               String newName)
                        throws IOException
Parameters:
fImage - source image file
width - the max width for the image
height - the max height for the image
newName - the new name for the image, can be null to keep old name
Returns:
the image with limit dimensions
Throws:
IOException - Signals that an I/O exception has occurred.


Copyright © 2013 Mairie de Paris. All Rights Reserved.