Package org.javlo.image
Class ImageHelper
- java.lang.Object
-
- org.javlo.image.ImageHelper
-
public class ImageHelper extends Object
- Author:
- pvanderm
-
-
Field Summary
Fields Modifier and Type Field Description static intBACK_AND_WHITE_FILTERprotected static Loggerloggercreate a static logger.static intNO_FILTER
-
Constructor Summary
Constructors Constructor Description ImageHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BufferedImagecreateAbsoluteLittleImage(javax.servlet.ServletContext servletContext, String name, int width)static voidcreateImage(File file, int fx, int fy)static BufferedImagecreateLittleImage(javax.servlet.ServletContext servletContext, String name, int width)static StringcreateSpecialDirectory(int width)static StringcreateSpecialDirectory(int width, int filter)static StringcreateSpecialDirectory(ContentContextBean ctxb, String context, String filter, String area, String deviceCode, Template template, IImageFilter comp, ImageConfig.ImageParameters param)static BufferedImagegetBestImageFromVideo(File file)static intgetColorCount(BufferedImage image)static doublegetContrastRatio(BufferedImage image)static Map<String,String>getExifData(InputStream in)static ImageSizegetExifSize(InputStream in)return dimension of picture in exif data, null if not found.static StringgetImageExtensionToManType(String ext)static StringgetImageFormat(String fileName)static ImageSizegetImageSize(File file)static ImageSizegetJpegSize(InputStream in)static BufferedImageloadImage(javax.servlet.ServletContext servletContext, String name)static voidmain(String[] args)static StringpathToKey(String path)transform a path in a string to a key. this key can be a directory name ( sp.static BufferedImageresize(BufferedImage aOrgImage, int width)static voidsaveImage(BufferedImage image, File file)static BufferedImagetoBufferedImage(org.jcodec.common.model.Picture src)static voidtoBufferedImage(org.jcodec.common.model.Picture src, BufferedImage dst)
-
-
-
Field Detail
-
logger
protected static Logger logger
create a static logger.
-
NO_FILTER
public static final int NO_FILTER
- See Also:
- Constant Field Values
-
BACK_AND_WHITE_FILTER
public static final int BACK_AND_WHITE_FILTER
- See Also:
- Constant Field Values
-
-
Method Detail
-
createSpecialDirectory
public static String createSpecialDirectory(int width)
-
createSpecialDirectory
public static String createSpecialDirectory(ContentContextBean ctxb, String context, String filter, String area, String deviceCode, Template template, IImageFilter comp, ImageConfig.ImageParameters param)
-
createSpecialDirectory
public static String createSpecialDirectory(int width, int filter)
-
pathToKey
public static String pathToKey(String path)
transform a path in a string to a key. this key can be a directory name ( sp. replace / and \ with _ ).- Parameters:
path- a path to a file- Returns:
- a key can be a directory name.
-
createAbsoluteLittleImage
public static BufferedImage createAbsoluteLittleImage(javax.servlet.ServletContext servletContext, String name, int width) throws IOException
- Throws:
IOException
-
loadImage
public static BufferedImage loadImage(javax.servlet.ServletContext servletContext, String name) throws IOException
- Throws:
IOException
-
createLittleImage
public static BufferedImage createLittleImage(javax.servlet.ServletContext servletContext, String name, int width) throws IOException
- Throws:
IOException
-
resize
public static BufferedImage resize(BufferedImage aOrgImage, int width)
-
getExifSize
public static ImageSize getExifSize(InputStream in) throws IOException
return dimension of picture in exif data, null if not found.- Parameters:
in-- Returns:
- Throws:
IOException
-
getJpegSize
public static ImageSize getJpegSize(InputStream in)
-
getImageSize
public static ImageSize getImageSize(File file) throws IOException
- Throws:
IOException
-
getExifData
public static Map<String,String> getExifData(InputStream in) throws IOException
- Throws:
IOException
-
createImage
public static void createImage(File file, int fx, int fy) throws IOException
- Throws:
IOException
-
toBufferedImage
public static BufferedImage toBufferedImage(org.jcodec.common.model.Picture src)
-
toBufferedImage
public static void toBufferedImage(org.jcodec.common.model.Picture src, BufferedImage dst)
-
getContrastRatio
public static double getContrastRatio(BufferedImage image)
-
saveImage
public static void saveImage(BufferedImage image, File file) throws IOException
- Throws:
IOException
-
getColorCount
public static int getColorCount(BufferedImage image)
-
getBestImageFromVideo
public static BufferedImage getBestImageFromVideo(File file) throws IOException, org.jcodec.api.JCodecException
- Throws:
IOExceptionorg.jcodec.api.JCodecException
-
-