GNOME Bugzilla – Bug 309219
EOG does not preserve EXIF data when saving pictures
Last modified: 2006-07-13 15:40:47 UTC
Please describe the problem: When doing some manipulation with a picture in EOG (e.g. rotating it) and then saving it (via Ctrl+S), the resulting image has its EXIF data part stripped. Steps to reproduce: 1. open some image with EXIF data present in EOG 2. rotate it, save it, close it 3. open it once more -> it does not have the EXIF data it had before the rotation+save Actual results: The EXIF data disappear from the picture. Expected results: The EXIF data will be preserved. Does this happen every time? No, it seems it depends on whether the name of the directory in which the picture is located contains spaces. Other information:
Created attachment 48464 [details] sample picture before any write action in EOG was performed
Created attachment 48465 [details] After rotation+save was performed Now the picture does not contain EXIF data.
It can be seen that EXIF data are present in the first picture, whereas the second lacks them: [erazim ~]$ jhead /home/media/Pictures/dir\ with\ spaces/pict0400-before.jpg File name : /home/media/Pictures/dir with spaces/pict0400-before.jpg File size : 952602 bytes File date : 2005:06:29 19:05:07 Camera make : KONICA MINOLTA Camera model : DiMAGE Z5 Date/Time : 2005:06:20 18:32:00 Resolution : 2560 x 1920 Flash used : No (auto) Focal length : 5.9mm (35mm equivalent: 35mm) Exposure time: 0.025 s (1/40) Aperture : f/2.8 ISO equiv. : 100 Whitebalance : Auto Metering Mode: matrix Exposure : program (auto) [erazim ~]$ jhead /home/media/Pictures/dir\ with\ spaces/pict0400-after.jpg File name : /home/media/Pictures/dir with spaces/pict0400-after.jpg File size : 506693 bytes File date : 2005:06:30 20:27:27 Resolution : 1920 x 2560 [erazim ~]$
Confirmed. Saving the file to a directory with spaces in its name seems to make a difference. Very strange.
*** Bug 312445 has been marked as a duplicate of this bug. ***
wow, yeah the space definitely makes a difference for some reason. It worked fine before I added a space to the location of the image.
Well, EOG prints a warning in this case: (eog:23764): Eog-WARNING **: Input file not openable: /home/felix/eogtest/folder%20with%20spaces/eogtest.jpg I don't think fopen (which causes this message with an ENOENT) understands entities like %20.
Created attachment 64621 [details] [review] try to fix it This is the only solution I could find yet. I'm not sure if gnome_vfs_format_uri_for_display() is correct here, but gnome_vfs_uri_to_string, g_filename_from{uri,utf8} didn't work.
Created attachment 64625 [details] [review] possibly better version This one uses gnome_vfs_unescape_string(), which seems more appropriate according to the docs.?
Patch applied in HEAD, gnome-2-14, and eog-ng branches. Thanks! 2006-07-13 Lucas Rocha <lucasr@gnome.org> * libeog/eog-image-jpeg.c (_save_jpeg_as_jpeg): avoid losing EXIF data when saving changed jpeg images (Fixes bug #309219). Patch from Felix Riemann <felix@hsgheli.de>.