I need to convert a tiff
image into a jpg
one using Apache Commons Imaging.
I tried to but I can't figure out how to do it using this library.
final BufferedImage image = Imaging.getBufferedImage(new File(image));
final ImageFormat format = ImageFormats.JPEG;
final Map<String, Object> params = new HashMap<>();
return Imaging.writeImageToBytes(image, format, params);
Where image
is my tiff
file to be converted, but I get
org.apache.commons.imaging.ImageWriteException: This image format (Jpeg-Custom) cannot be written.
I don't understand what I'm doing wrong could someone help?