decoded TIFF printing problem in Java 1.6
I am running into a compatability problem between JDK 1.5 and 1.6 while printing a decoded TIFF file
Following is my small test code:
public int print(Graphics g, PageFormat pf, int pageIndex)
PlanarImage pi = JAIImageLoader.load(new File("out.tiff")); // here I load the TIFF file
Image image = pi.getAsBufferedImage();
Graphics2D g2d = (Graphics2D) g;
g2d.drawImage(image, 0, 0, null);
This code produces a normal quality printout under JDK 1.5
and a very low quality printout under 1.6
It should be noted that if I use the following to load a JPG image it works fine both for 1.5 and 1.6 so the issue appears to be with the way JAI loads this TIFF file.
image = new ImageIcon("out.jpg").getImage();
I would greatly appreciate any help with this!