1

I got this code:

java.awt.image.BufferedImage bi = javax.imageio.ImageIO.read(attachment.getAttachmentAsBlob().getBinaryStream());

Although the Binary Stream is byte array of 3727458 bytes, the function returns null.

My purpose is to get a Blob from Oracle which is a TIFF image and convert it to PNG, do I have some other alternatives to make it?

roeygol
  • 4,908
  • 9
  • 51
  • 88
  • Returns a BufferedImage as the result of decoding a supplied ImageInputStream with an ImageReader chosen automatically from among those currently registered. If no registered ImageReader claims to be able to read the stream, null is returned. So perhaps no ImageReader claims to be able to read the stream – Justin Jan 03 '19 at 20:25
  • could you please comment a reference to an example of it? an answer would be wonderful. – roeygol Jan 03 '19 at 20:28
  • 1
    Based on some quick googling and the JavaDocs, TIFF is only supported out of the box for Java 9+, previous versions relied on the Java Advanced Imaging API (JAI), or other plug-in – MadProgrammer Jan 03 '19 at 20:34

0 Answers0