You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "FG (JIRA)" <ji...@apache.org> on 2010/03/06 21:48:27 UTC

[jira] Created: (SANSELAN-37) Wrinting unmodified EXIF-Data to new image changes values

Wrinting unmodified EXIF-Data to new image changes values
---------------------------------------------------------

                 Key: SANSELAN-37
                 URL: https://issues.apache.org/jira/browse/SANSELAN-37
             Project: Commons Sanselan
          Issue Type: Bug
    Affects Versions: 0.94-incubator
         Environment: Canon Powershot A570 IS
            Reporter: FG


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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SANSELAN-37) Wrinting unmodified EXIF-Data to new image changes values

Posted by "FG (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANSELAN-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844166#action_12844166 ] 

FG commented on SANSELAN-37:
----------------------------

I could track the error a bit further: 
All fields that are shown using this code
        IImageMetadata metadata = Sanselan.getMetadata(src1);
        ((JpegImageMetadata) metadata).dump();
were written correctly. But from the remaining fields, some were changed:

Original:
Self timer - Off
Flash mode - Auto + red-eye reduction
Focus mode - Single
Sharpness - Normal
ISO Value - Auto
Metering mode - Evaluative
Exposure mode - Easy shooting
Focal length - 5800 - 23200 mm (1000 mm)
Flash activity - 
Subject Distance - 85
Image Type - IMG:PowerShot A570 IS JPEG
Firmware Version - Firmware Version 1.01
Owner Name - 
Sharpness (0D) - 65521
JpegIFOffset - 5108

changed to the following:
Self timer - 5/10 sec
Flash mode - Not fired
Focus mode - One-Shot
Sharpness - High , +15
ISO Value - 3
Metering mode - Center weighted averaging
Exposure mode - 
Focal length - 1000 - 5800 mm (88 mm)
Flash activity - Not fired
Subject Distance - 0
Image Type - G:PowerShot A570 IS JPEG
Firmware Version - rmware Version 1.01
Owner Name - s
Sharpness (0D) - 65535
JpegIFOffset - 3508

> Wrinting unmodified EXIF-Data to new image changes values
> ---------------------------------------------------------
>
>                 Key: SANSELAN-37
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-37
>             Project: Commons Sanselan
>          Issue Type: Bug
>    Affects Versions: 0.94-incubator
>         Environment: Canon Powershot A570 IS
>            Reporter: FG
>         Attachments: diff.txt, out.jpg, out.txt, src.txt, src1.jpg, src2.jpg
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SANSELAN-37) Wrinting unmodified EXIF-Data to new image changes values

Posted by "FG (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANSELAN-37?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

FG updated SANSELAN-37:
-----------------------

    Attachment: diff.txt
                src.txt
                out.txt

Plain exif data as extracted by IrfanView.
diff.txt shows the difference between the src and out file.

> Wrinting unmodified EXIF-Data to new image changes values
> ---------------------------------------------------------
>
>                 Key: SANSELAN-37
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-37
>             Project: Commons Sanselan
>          Issue Type: Bug
>    Affects Versions: 0.94-incubator
>         Environment: Canon Powershot A570 IS
>            Reporter: FG
>         Attachments: diff.txt, out.jpg, out.txt, src.txt, src1.jpg, src2.jpg
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SANSELAN-37) Wrinting unmodified EXIF-Data to new image changes values

Posted by "FG (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANSELAN-37?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

FG updated SANSELAN-37:
-----------------------

    Attachment: out.jpg
                src2.jpg
                src1.jpg

Input images and output image as it was created by my code.
Images were opened in Irfanview and resized to ~1x1 pixel to reduce the sample. Exif data was preserved in the first image. src2 was saved via IrfanView with the option to remove all EXIF data.

> Wrinting unmodified EXIF-Data to new image changes values
> ---------------------------------------------------------
>
>                 Key: SANSELAN-37
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-37
>             Project: Commons Sanselan
>          Issue Type: Bug
>    Affects Versions: 0.94-incubator
>         Environment: Canon Powershot A570 IS
>            Reporter: FG
>         Attachments: out.jpg, src1.jpg, src2.jpg
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SANSELAN-37) Wrinting unmodified EXIF-Data to new image changes values

Posted by "FG (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANSELAN-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844618#action_12844618 ] 

FG commented on SANSELAN-37:
----------------------------

Oh, and actually that could be exactly what the javadoc of updateExifMetadataLossless() describes:

http://commons.apache.org/sanselan/api-release/org/apache/sanselan/formats/jpeg/exifRewrite/ExifRewriter.html :
Note that this uses the "Lossless" approach - in order to preserve data embedded in the EXIF segment that it can't parse (such as Maker Notes), this algorithm avoids overwriting any part of the original segment that it couldn't parse. This can cause the EXIF segment to grow with each update, which is a serious issue, since all EXIF data must fit in a single APP1 segment of the Jpeg image. 

So this issue might be closed?

> Wrinting unmodified EXIF-Data to new image changes values
> ---------------------------------------------------------
>
>                 Key: SANSELAN-37
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-37
>             Project: Commons Sanselan
>          Issue Type: Bug
>    Affects Versions: 0.94-incubator
>         Environment: Canon Powershot A570 IS
>            Reporter: FG
>         Attachments: diff.txt, out.jpg, out.txt, src.txt, src1.jpg, src2.jpg
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.