railo.runtime.img
Class ImageUtil

java.lang.Object
  extended by railo.runtime.img.ImageUtil

public class ImageUtil
extends Object


Constructor Summary
ImageUtil()
           
 
Method Summary
static void closeEL(ImageInputStream iis)
           
static BufferedImage createBufferedImage(BufferedImage image)
           
static BufferedImage createBufferedImage(BufferedImage image, int columns, int rows)
           
static String getFormat(byte[] binary)
           
static String getFormat(byte[] binary, String defaultValue)
           
static String getFormat(Resource res)
           
static String getFormatFromExtension(Resource res, String defaultValue)
           
static String getFormatFromMimeType(String mt)
           
static String getFormatFromMimeType(String mt, String defaultValue)
           
static String getMimeTypeFromFormat(String mt)
           
static String[] getReaderFormatNames()
           
static String[] getWriterFormatNames()
           
static byte[] readBase64(String b64str)
           
static BufferedImage toBufferedImage(byte[] bytes, String format)
          translate a binary array to a buffered image
static BufferedImage toBufferedImage(Resource res, String format)
          translate a file resource to a buffered image
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageUtil

public ImageUtil()
Method Detail

getWriterFormatNames

public static String[] getWriterFormatNames()

getReaderFormatNames

public static String[] getReaderFormatNames()

toBufferedImage

public static BufferedImage toBufferedImage(Resource res,
                                            String format)
                                     throws IOException
translate a file resource to a buffered image

Parameters:
res -
Returns:
Throws:
IOException

toBufferedImage

public static BufferedImage toBufferedImage(byte[] bytes,
                                            String format)
                                     throws IOException
translate a binary array to a buffered image

Parameters:
binary -
Returns:
Throws:
IOException

readBase64

public static byte[] readBase64(String b64str)
                         throws ExpressionException
Throws:
ExpressionException

getFormat

public static String getFormat(Resource res)
                        throws IOException
Throws:
IOException

getFormat

public static String getFormat(byte[] binary)
                        throws IOException
Throws:
IOException

getFormat

public static String getFormat(byte[] binary,
                               String defaultValue)

getFormatFromExtension

public static String getFormatFromExtension(Resource res,
                                            String defaultValue)

getFormatFromMimeType

public static String getFormatFromMimeType(String mt)
                                    throws IOException
Throws:
IOException

getFormatFromMimeType

public static String getFormatFromMimeType(String mt,
                                           String defaultValue)

getMimeTypeFromFormat

public static String getMimeTypeFromFormat(String mt)
                                    throws IOException
Throws:
IOException

closeEL

public static void closeEL(ImageInputStream iis)

createBufferedImage

public static BufferedImage createBufferedImage(BufferedImage image,
                                                int columns,
                                                int rows)

createBufferedImage

public static BufferedImage createBufferedImage(BufferedImage image)


Copyright © 2012 Railo