Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4766734

Incompatibility between JDK 1.4 and Windows XP Fax and Picture Viewer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.4.1
    • client-libs

      Customer says:

      I have noticed an incompatibility between JPG files that are output from Windows XP Fax and Picture Viewer and read in by JDK 1.4 (or 1.4.1). In particular, when an image is transfered from a digital camera to a Windows XP machine, then rotated and saved in the Windows XP Fax and Picture Viewer, the resulting image file appears with corrupted colors when read and saved by the ImageIO class in JDK 1.4.

      Here is my code:

      import java.awt.image.BufferedImage;
      import javax.imageio.ImageIO;

      BufferedImage buffImg = ImageIO.read (new File ("in.jpg"));
      ImageIO.write (buffImg, "jpg", new File ("out.jpg"));

      I have also output the file with graphics format PNG and seen similar apparent corruption of colors.

      This is an image that was loaded onto Windows XP from a digital camera then rotated 90 degrees and saved with the Windows XP Fax and Picture Viewer:
      http://www.adigitalsolution.net/pics/verticalOrig.jpg

      Here is the same image read and written by JDK 1.4 ImageIO.read() and ImageIO.write():

      http://www.adigitalsolution.net/pics/verticalJavaOut.jpg

      Note that the colors appear corrupted in the above image.

      This is an image copied directly from a Sony Cybershot DSC - P71 digital camera:
      http://www.adigitalsolution.net/pics/horizontalOrig.jpg

      Here is the same image read and written by JDK 1.4 ImageIO.read() and ImageIO.write():

      http://www.adigitalsolution.net/pics/horizontalJavaOut.jpg

      It appears fine (brilliant tropical colors).

      Note that both images contain the "EXIF" header, which is the JPEG-like format used by many digital cameras. Some may say that the JDK 1.4 spec does not support EXIF, but the image not touched by Windows XP was read successfully. And other image editing programs read in both successfully, such as PaintshopPro and the Mozilla 1.0 web browser. But there is a specific incompatibility with JDK 1.4.

      I have reproduced this problem on Windows NT 4 and Red Hat Linux 7.3 using an image file that was saved on Windows XP.

      Here is a warning from Nikon about the behavior of Windows XP Fax and Picture Viewer:

      http://www.dpreview.com/news/0112/01121402nikonxpwarnings.asp

            Unassigned Unassigned
            gnagasunsunw Gopinath Nagasundara (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: