Uploaded image for project: 'Commons Imaging'
  1. Commons Imaging
  2. IMAGING-14

Wrinting unmodified EXIF-Data to new image changes values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 0.94-incubator
    • None
    • None
    • None
    • Canon Powershot A570 IS

    Description

      I used the following code, which just reads the EXIF data from a picture of a Canon Powershot A570 IS and writes it back to another file without modifying it:

      File src1 = new File("c:/temp/src1.jpg");
      File src2 = new File("c:/temp/src2.jpg");
      File dst = new File("c:/temp/out.jpg");
      IImageMetadata metadata = Sanselan.getMetadata(src1);
      TiffImageMetadata exif = ((JpegImageMetadata) metadata).getExif();
      TiffOutputSet outputSet = exif.getOutputSet();
      OutputStream os = new BufferedOutputStream(new FileOutputStream(dst));
      new ExifRewriter().updateExifMetadataLossless(src2, os, outputSet);
      os.close();

      src1.jpg is a file with EXIF data
      src2.jpg is src1.jpg without EXIF data (saved it with IrfanView and unchecked the appropriate checkboxes in the Jpeg Save Dialog)
      out.jpg should contain the EXIF information after the code was run.
      Actually the EXIF data is not the same after the call.

      So, is there anything wrong with the above code or with the images or is
      this a bug in Sanselan?

      Tried the same with the image of a Sony Alpha 350. The effect was much less.
      I try to attach the images and exif data in the next step.

      Attachments

        1. diff.txt
          1 kB
          FG
        2. src.txt
          2 kB
          FG
        3. out.txt
          2 kB
          FG
        4. out.jpg
          8 kB
          FG
        5. src2.jpg
          0.3 kB
          FG
        6. src1.jpg
          10 kB
          FG

        Activity

          People

            Unassigned Unassigned
            locked FG
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: