I'm trying to write a tiff image file out using ImageIo, but even though I'm following the recommended guidelines and other tips, it isn't writing. There's no error message given. It just doesn't write.
Here is the code:
BufferedImage bImageFromConvert = new BufferedImage(dimWidth, dimHeight * 2, BufferedImage.TYPE_BYTE_GRAY);//dimWidth and dimHeight are set elsewhere in the program. For now, assume they are equal to 100
byte[] bufferHolder = ((DataBufferByte) bImageFromConvert.getRaster().getDataBuffer()).getData();
System.arraycopy(imageInByte, 0, bufferHolder, 0, imageInByte.length); //imageInByte is the byte array containing all of my tiff image data.
ImageIO.write(bImageFromConvert, "TIFF", new File(
"C:\\out.tif"));
I need the file extension to be "tif" and not "tiff" because I'm working with JP2K (which only recognizes the former extension).
Thank you!