Package org.apache.ofbiz.common.image
Class ImageTransform
- java.lang.Object
-
- org.apache.ofbiz.common.image.ImageTransform
-
public class ImageTransform extends java.lang.Object
ImageTransform ClassServices to apply transformation to images
-
-
Constructor Summary
Constructors Constructor Description ImageTransform()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<java.lang.String,java.lang.Object>
getBufferedImage(java.lang.String fileLocation, java.util.Locale locale)
getBufferedImagestatic java.util.Map<java.lang.String,java.lang.Object>
getXMLValue(java.lang.String fileFullPath, java.util.Locale locale)
getXMLValuestatic java.util.Map<java.lang.String,java.lang.Object>
scaleImage(java.awt.image.BufferedImage bufImg, double imgHeight, double imgWidth, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> dimensionMap, java.lang.String sizeType, java.util.Locale locale)
scaleImagestatic java.awt.image.BufferedImage
toBufferedImage(java.awt.Image image)
toBufferedImagestatic java.awt.image.BufferedImage
toBufferedImage(java.awt.Image image, int bufImgType)
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
resource
public static final java.lang.String resource
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBufferedImage
public static java.util.Map<java.lang.String,java.lang.Object> getBufferedImage(java.lang.String fileLocation, java.util.Locale locale) throws java.lang.IllegalArgumentException, java.io.IOException
getBufferedImageSet a buffered image
- Parameters:
fileLocation
- Full file Path or URL- Returns:
- URL images for all different size types
- Throws:
java.io.IOException
- Error prevents the document from being fully parsedjava.lang.IllegalArgumentException
- Errors occur in parsing
-
scaleImage
public static java.util.Map<java.lang.String,java.lang.Object> scaleImage(java.awt.image.BufferedImage bufImg, double imgHeight, double imgWidth, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> dimensionMap, java.lang.String sizeType, java.util.Locale locale)
scaleImagescale original image related to the ImageProperties.xml dimensions
- Parameters:
bufImg
- Buffered image to scaleimgHeight
- Original image heightimgWidth
- Original image widthdimensionMap
- Image dimensions by size typesizeType
- Size type to scale- Returns:
- New scaled buffered image
-
getXMLValue
public static java.util.Map<java.lang.String,java.lang.Object> getXMLValue(java.lang.String fileFullPath, java.util.Locale locale) throws java.lang.IllegalStateException, java.io.IOException
getXMLValueFrom a XML element, get a values map
- Parameters:
fileFullPath
- File path to parse- Returns:
- Map contains asked attribute values by attribute name
- Throws:
java.lang.IllegalStateException
java.io.IOException
-
toBufferedImage
public static java.awt.image.BufferedImage toBufferedImage(java.awt.Image image)
toBufferedImageTransform from an Image instance to a BufferedImage instance
- Parameters:
image
- Source image- Returns:
- BufferedImage
-
toBufferedImage
public static java.awt.image.BufferedImage toBufferedImage(java.awt.Image image, int bufImgType)
-
-