Package com.idrsolutions.image
Class JDeli
java.lang.Object
com.idrsolutions.image.JDeliImage
com.idrsolutions.image.JDeli
public class JDeli
extends com.idrsolutions.image.JDeliImage
Class reads, writes and processes images.
 
Example to read an image, where:
- imageFile is of type File
 JDeli.read(imageFile);
 Example to write an image, where:
- image is of type BufferedImage
- outputFormat is of type OutputFormat
- outputFile is of type File
 JDeli.write(image, OutputFormat.PNG, outputFile);
 or
 JDeli.write(image, "png", outputFile);
 or
 JDeli.write(image, "png", outputStream);
 - 
Field SummaryFields inherited from class com.idrsolutions.image.JDeliImagebb
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic byte[]convert(byte[] inputData, EncoderOptions options) Convert between any supported image file formats and process imagestatic byte[]Convert between any supported image file formats and process imagestatic byte[]convert(byte[] inputData, String format, ImageProcessingOps operations) Convert between any supported image file formats and process imagestatic voidconvert(File inputFile, EncoderOptions outputOptions, File outputFile) Convert between any supported image file formatsstatic voidConvert between any supported image file formatsstatic voidconvert(File inputFile, File outputFile, ImageProcessingOps operations) Convert between any supported image file formats and process imagestatic voidconvert(InputStream inputStream, EncoderOptions outputOptions, OutputStream outputStream, String format) Convert between any supported image file formatsstatic voidconvert(InputStream inputStream, OutputStream outputStream, String format) Convert between any supported image file formats and process imagestatic voidconvert(InputStream inputStream, OutputStream outputStream, String format, ImageProcessingOps operations) Convert between any supported image file formats and process imagestatic byte[]filter(byte[] raw_data, FilterOptions options) This method filters the data using the chosen algorithmstatic voidfilter(InputStream inputStream, FilterOptions options, OutputStream outputStream) This method filters the data using the chosen algorithmstatic MetadatagetImageInfo(byte[] imageBytes) Returns Metadata object describing Imagestatic MetadatagetImageInfo(File imageFile) Returns Metadata object describing Imagestatic MetadatagetImageInfo(InputStream inputStream) Returns Metadata object describing Imagestatic booleanisImageSupportedForInput(String formatName) return whether the image format name is supported for reading fromstatic booleanisImageSupportedForOutput(String formatName) return whether the image format name is supported for writingstatic BufferedImageprocess(ImageProcessingOps operations, BufferedImage image) Returns BufferedImage with processing options appliedstatic BufferedImageread(byte[] data) Returns BufferedImage from InputStream if supported ImageType bytesstatic BufferedImageReturns BufferedImage from the byte[] if supported ImageTypestatic BufferedImageReturns BufferedImage from the File object if supported ImageTypestatic BufferedImageReturns BufferedImage from the File object if supported ImageTypestatic BufferedImageread(InputStream is) Returns BufferedImage from InputStream if supported ImageType streamstatic BufferedImageread(InputStream is, HashMap<String, String> map) Returns BufferedImage from InputStream if supported ImageTypestatic RectanglereadDimension(byte[] imageBytes) Returns an Image dimensionsstatic RectanglereadDimension(File imageFile) Returns an Image dimensionsstatic RectanglereadDimension(InputStream inputStream) Returns an Image dimensionsstatic BufferedImagereadEmbeddedThumbnail(byte[] imageBytes) Returns an embedded Thumbnail if found in Image file (or null)static BufferedImagereadEmbeddedThumbnail(File imageFile) Returns an embedded Thumbnail if found in Image file (or null)static BufferedImagereadEmbeddedThumbnail(InputStream inputStream) Returns an embedded Thumbnail if found in Image file (or null)static byte[]write(BufferedImage image, EncoderOptions options) This method compress the buffered image into given output formatstatic voidwrite(BufferedImage image, EncoderOptions options, File outputFile) This method compress the buffered image into given output formatstatic voidwrite(BufferedImage image, EncoderOptions options, OutputStream outputStream) This method compress the buffered image into given output formatstatic voidwrite(BufferedImage image, OutputFormat format, File outputFile) This method compress the buffered image into given output formatstatic voidwrite(BufferedImage image, OutputFormat format, OutputStream outputStream) This method compress the buffered image into given output formatstatic byte[]write(BufferedImage image, String formatName) This method writes out a BufferedImage to any supported ImageType to a byte[] arraystatic voidwrite(BufferedImage image, String formatName, File outputFile) This method writes out a BufferedImage to any supported ImageTypestatic voidwrite(BufferedImage image, String formatName, OutputStream stream) This method writes out a BufferedImage to any supported ImageTypeMethods inherited from class com.idrsolutions.image.JDeliImageoptimiseImage
- 
Constructor Details- 
JDelipublic JDeli()
 
- 
- 
Method Details- 
convertConvert between any supported image file formats- Parameters:
- inputFile- source file
- outputFile- destination for output
- Throws:
- Exception- if an error occurs in converting image
 
- 
convertpublic static void convert(File inputFile, EncoderOptions outputOptions, File outputFile) throws Exception Convert between any supported image file formats- Parameters:
- inputFile- source file
- outputOptions- set values to control output
- outputFile- destination for output
- Throws:
- Exception- if an error occurs in converting image
 
- 
convertpublic static void convert(InputStream inputStream, EncoderOptions outputOptions, OutputStream outputStream, String format) throws Exception Convert between any supported image file formats- Parameters:
- inputStream- source inputStream
- outputOptions- set values to control output
- outputStream- destination for output
- format- image format
- Throws:
- Exception- if an error occurs in converting image
 
- 
convertpublic static void convert(File inputFile, File outputFile, ImageProcessingOps operations) throws Exception Convert between any supported image file formats and process image- Parameters:
- inputFile- source file
- outputFile- destination for output
- operations- image processing operations to perform
- Throws:
- Exception- if an error occurs in converting image
 
- 
processReturns BufferedImage with processing options applied- Parameters:
- operations- Image processing operations to apply
- image- source image for processing
- Returns:
- BufferedImage
 
- 
convertpublic static void convert(InputStream inputStream, OutputStream outputStream, String format) throws Exception Convert between any supported image file formats and process image- Parameters:
- inputStream- source InputStream
- outputStream- destination OutpytStream
- format- image filetype (ie PNG)
- Throws:
- Exception- if an error occurs in converting image
 
- 
convertpublic static void convert(InputStream inputStream, OutputStream outputStream, String format, ImageProcessingOps operations) throws Exception Convert between any supported image file formats and process image- Parameters:
- inputStream- source InputStream
- outputStream- destination OutputStream
- format- image filetype (ie PNG)
- operations- image processing operations to perform
- Throws:
- Exception- if an error occurs in converting image
 
- 
convertConvert between any supported image file formats and process image- Parameters:
- inputData- byte[] containing image data
- format- image filetype (ie PNG)
- Returns:
- byte[] object containing output image data
- Throws:
- Exception- if an error occurs in converting image
 
- 
convertpublic static byte[] convert(byte[] inputData, String format, ImageProcessingOps operations) throws Exception Convert between any supported image file formats and process image- Parameters:
- inputData- byte[] containing image data
- format- image filetype (ie PNG)
- operations- image processing operations to perform
- Returns:
- byte[] object containing output image data
- Throws:
- Exception- if an error occurs in converting image
 
- 
convertConvert between any supported image file formats and process image- Parameters:
- inputData- byte[] containing image data
- options- options to use when encoding
- Returns:
- byte[] object containing output image data
- Throws:
- Exception- if an error occurs in converting image
 
- 
getImageInfoReturns Metadata object describing Image- Parameters:
- imageFile- source image path
- Returns:
- Specific instance of Metadata (ie BMPMetadata)
- Throws:
- Exception- if an error occurs in reading image
 
- 
getImageInfoReturns Metadata object describing Image- Parameters:
- imageBytes- source image data
- Returns:
- Specific instance of Metadata (ie BMPMetadata)
- Throws:
- Exception- if an error occurs in reading image
 
- 
getImageInfoReturns Metadata object describing Image- Parameters:
- inputStream- source for image data
- Returns:
- Specific instance of Metadata (ie BMPMetadata)
- Throws:
- Exception- if an error occurs in reading image
 
- 
readEmbeddedThumbnailReturns an embedded Thumbnail if found in Image file (or null)- Parameters:
- imageBytes- source image data
- Returns:
- BufferedImage or null if no embedded thumbnail present
- Throws:
- Exception- if an error occurs in reading image
 
- 
readEmbeddedThumbnailReturns an embedded Thumbnail if found in Image file (or null)- Parameters:
- imageFile- source image path
- Returns:
- BufferedImage or null if no embedded thumbnail present
- Throws:
- Exception- if an error occurs in reading image
 
- 
readEmbeddedThumbnailReturns an embedded Thumbnail if found in Image file (or null)- Parameters:
- inputStream- source image path
- Returns:
- BufferedImage or null if no embedded thumbnail present
- Throws:
- Exception- if an error occurs in reading image
 
- 
readDimensionReturns an Image dimensions- Parameters:
- imageBytes- source image data
- Returns:
- Rectangle or null if not supported or unable to read
- Throws:
- Exception- if an error occurs in reading image
 
- 
readDimensionReturns an Image dimensions- Parameters:
- imageFile- source image path
- Returns:
- Rectangle or null if not supported or unable to read
- Throws:
- Exception- if an error occurs in reading image
 
- 
readDimensionReturns an Image dimensions- Parameters:
- inputStream- source image path
- Returns:
- Rectangle or null if not supported or unable to read
- Throws:
- Exception- if an error occurs in reading image
 
- 
readReturns BufferedImage from the File object if supported ImageType- Parameters:
- imageFile- path for image file
- Returns:
- BufferedImage
- Throws:
- Exception- if an error occurs in reading image
 
- 
readReturns BufferedImage from the File object if supported ImageType- Parameters:
- imageFile- path for image file
- map- map to put custom parameters
- Returns:
- BufferedImage
- Throws:
- Exception- if an error occurs in reading image
 
- 
readReturns BufferedImage from the byte[] if supported ImageType- Parameters:
- data- compressed image data as bytes
- map- map to put custom parameters
- Returns:
- BufferedImage
- Throws:
- Exception- if an error occurs in reading image
 
- 
readReturns BufferedImage from InputStream if supported ImageType bytes- Parameters:
- data- raw image bytes
- Returns:
- BufferedImage
- Throws:
- Exception- if an error occurs in reading image
 
- 
readReturns BufferedImage from InputStream if supported ImageType- Parameters:
- is- input stream to read from
- map- configuration options to apply
- Returns:
- BufferedImage
- Throws:
- Exception- if an error occurs in reading image
- See Also:
- Implementation Note:
- If you are passing in a ByteArrayInputStream it may be more effective to use our read(byte[], HashMap) method instead
 
- 
readReturns BufferedImage from InputStream if supported ImageType stream- Parameters:
- is- input stream to read from
- Returns:
- BufferedImage
- Throws:
- Exception- if an error occurs in reading image
- See Also:
- Implementation Note:
- If you are passing in a ByteArrayInputStream it may be more effective to use our read(byte[]) method instead
 
- 
writepublic static void write(BufferedImage image, EncoderOptions options, File outputFile) throws Exception This method compress the buffered image into given output format- Parameters:
- image- bufferedImage
- options- WriterOptions
- outputFile- output file
- Throws:
- Exception- if an error occurs in reading image
- See Also:
 
- 
writeThis method compress the buffered image into given output format- Parameters:
- image- bufferedImage
- options- WriterOptions
- Returns:
- byte[] the data array written out or an empty array if no encoder is found
- Throws:
- Exception- if an error occurs in reading image
- See Also:
 
- 
writepublic static void write(BufferedImage image, OutputFormat format, File outputFile) throws Exception This method compress the buffered image into given output format- Parameters:
- image- bufferedImage
- format- output format
- outputFile- output file
- Throws:
- Exception- if an error occurs in reading image
- See Also:
 
- 
writeThis method writes out a BufferedImage to any supported ImageType- Parameters:
- image- bufferedImage
- formatName- output format name
- outputFile- output file
- Throws:
- Exception- if an error occurs in writing image
- See Also:
 
- 
filterThis method filters the data using the chosen algorithm- Parameters:
- raw_data- byte[]
- options- FilterOptions
- Returns:
- byte[] the data array written out
- Throws:
- Exception- if an error occurs in filter operation
 
- 
filterpublic static void filter(InputStream inputStream, FilterOptions options, OutputStream outputStream) throws Exception This method filters the data using the chosen algorithm- Parameters:
- inputStream- InputStream
- options- FilterOptions
- outputStream- OutputStream
- Throws:
- Exception- if an error occurs in filter operation
- See Also:
 
- 
isImageSupportedForOutputreturn whether the image format name is supported for writing- Parameters:
- formatName- three letter file format
- Returns:
- value to show if image can be output by jdeli
 
- 
isImageSupportedForInputreturn whether the image format name is supported for reading from- Parameters:
- formatName- three letter file format
- Returns:
- value to show if image can be read by jdeli
 
- 
writeThis method writes out a BufferedImage to any supported ImageType to a byte[] array- Parameters:
- image- bufferedImage
- formatName- output format name
- Returns:
- byte[] with output image as bytes
- Throws:
- Exception- if an error occurs in writing image
 
- 
writepublic static void write(BufferedImage image, String formatName, OutputStream stream) throws Exception This method writes out a BufferedImage to any supported ImageTypeThis method does not close the provided OutputStream after the write operation has completed; it is the responsibility of the caller to close the stream. - Parameters:
- image- bufferedImage
- formatName- output format name
- stream- output stream
- Throws:
- Exception- if an error occurs in writing image
 
- 
writepublic static void write(BufferedImage image, EncoderOptions options, OutputStream outputStream) throws Exception This method compress the buffered image into given output formatThis method does not close the provided OutputStream after the write operation has completed; it is the responsibility of the caller to close the stream. - Parameters:
- image- bufferedImage
- options- WriterOptions
- outputStream- outputStream
- Throws:
- Exception- if an error occurs in writing image
- See Also:
 
- 
writepublic static void write(BufferedImage image, OutputFormat format, OutputStream outputStream) throws Exception This method compress the buffered image into given output formatThis method does not close the provided OutputStream after the write operation has completed; it is the responsibility of the caller to close the stream. - Parameters:
- image- bufferedImage
- format- output format
- outputStream- outputStream
- Throws:
- Exception- if an error occurs in writing image
- See Also:
 
 
-