After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 624775 - Can't rotate jpeg: "Unable to rotate this type of photo"
Can't rotate jpeg: "Unable to rotate this type of photo"
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: Editing
0.7.1
Other Linux
: Normal major
: 0.8.0
Assigned To: F-spot maintainers
F-spot maintainers
Depends on:
Blocks:
 
 
Reported: 2010-07-19 22:48 UTC by Dave Sill
Modified: 2010-09-19 12:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Image the rotates fine in F-Spot (63.00 KB, image/jpeg)
2010-09-09 15:17 UTC, Henry Gomersall
  Details
Breaks the rotation tool in F-Spot (148.17 KB, image/jpeg)
2010-09-09 15:18 UTC, Henry Gomersall
  Details
Make sure metadata write on rotate also works for broken files. (4.56 KB, patch)
2010-09-13 08:24 UTC, Ruben Vermeersch
none Details | Review
Make sure metadata write on rotate also works for broken files. (4.67 KB, patch)
2010-09-13 08:38 UTC, Ruben Vermeersch
committed Details | Review

Description Dave Sill 2010-07-19 22:48:16 UTC
Trying to rotate a jpeg photo by 90 degrees I get the message:

Error while rotating file.
Received error "Unable to rotate this type of photo" while attempting to rotate 100_0008.JPG
Comment 1 Dave Sill 2010-07-19 22:51:37 UTC
Here's debug output:


** Running f-spot in Debug Mode **
** Running Mono with --debug   **
[1 Info  18:50:09.162] Initializing Mono.Addins
[1 Debug 18:50:09.356] Mono.Addins Initialization took 0.183935
[1 Debug 18:50:09.722] Db Initialization took 0.246438
[1 Debug 18:50:10.232] Query Started : SELECT * FROM photos  WHERE  photos.id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = 2) ORDER BY  time DESC, filename ASC 
[1 Debug 18:50:10.495] QueryToTemp took 0.263405 : SELECT * FROM photos  WHERE  photos.id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = 2) ORDER BY  time DESC, filename ASC 
[1 Debug 18:50:10.495] Reloading the query took 0.266656
[2 Debug 18:50:10.887] PhotosPerMonth took 0.136087
[2 Debug 18:50:10.890] TimeAdaptor REAL Reload took 0.350013
[1 Debug 18:50:10.899] Query took 0.054377 : SELECT * FROM photoquery_temp_0 LIMIT 100 OFFSET 0
[1 Debug 18:50:10.939] Query Started : SELECT * FROM photos  WHERE  photos.id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = 2) ORDER BY  time ASC, filename ASC 
[1 Debug 18:50:11.173] QueryToTemp took 0.234135 : SELECT * FROM photos  WHERE  photos.id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = 2) ORDER BY  time ASC, filename ASC 
[1 Debug 18:50:11.192] Query took 0.007787 : SELECT * FROM photoquery_temp_0 LIMIT 100 OFFSET 0
[1 Debug 18:50:11.314] open uri = file:///data/photos/Photos/2003/2003-06 Erica's British and Irish Adventure/dcp_3691.jpg
[1 Debug 18:50:11.334] Reloading the query took 0.396165
[1 Debug 18:50:11.419] Query Started : SELECT * FROM photos  WHERE  photos.id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = 2) ORDER BY  time ASC, filename ASC 
[3 Debug 18:50:11.539] PhotosPerMonth took 0.153268
[3 Debug 18:50:11.540] TimeAdaptor REAL Reload took 0.364912
[1 Debug 18:50:11.766] QueryToTemp took 0.347106 : SELECT * FROM photos  WHERE  photos.id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = 2) ORDER BY  time ASC, filename ASC 
[1 Debug 18:50:11.797] IndexOf took 0.01026 : SELECT ROWID AS row_id FROM photoquery_temp_0 WHERE id = 7905
[1 Debug 18:50:11.797] Reloading the query took 0.378168
[1 Debug 18:50:11.962] IndexOf took 0.020749 : SELECT ROWID AS row_id FROM photoquery_temp_0 WHERE time >= 925534800 ORDER BY time ASC LIMIT 1
[1 Debug 18:50:11.966] Query took 0.003938 : SELECT * FROM photoquery_temp_0 LIMIT 100 OFFSET 0
[1 Debug 18:50:11.970] IndexOf took 0.00435 : SELECT ROWID AS row_id FROM photoquery_temp_0 WHERE id = 7905
[4 Debug 18:50:12.205] PhotosPerMonth took 0.230224
[4 Debug 18:50:12.205] TimeAdaptor REAL Reload took 0.438216
[1 Debug 18:50:12.342] Loading image took 1.147595
[1 Debug 18:50:16.188] Query Started : SELECT * FROM photos  WHERE  photos.roll_id IN (37)  AND  photos.id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = 2) ORDER BY  time ASC, filename ASC 
[1 Debug 18:50:16.220] QueryToTemp took 0.031998 : SELECT * FROM photos  WHERE  photos.roll_id IN (37)  AND  photos.id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = 2) ORDER BY  time ASC, filename ASC 
[1 Debug 18:50:16.226] IndexOf took 0.000298 : SELECT ROWID AS row_id FROM photoquery_temp_0 WHERE id = 7905
[1 Debug 18:50:16.230] Query took 0.003828 : SELECT * FROM photoquery_temp_0 LIMIT 100 OFFSET 0
[1 Debug 18:50:16.250] open uri = file:///data/photos/2010/01/15/100_0008.JPG
[1 Debug 18:50:16.273] Reloading the query took 0.084745

(f-spot:4316): GdkPixbuf-WARNING **: GdkPixbufLoader finalized without calling gdk_pixbuf_loader_close() - this is not allowed. You must explicitly end the data stream to the loader before dropping the last reference.
[5 Debug 18:50:16.631] PhotosPerMonth took 0.195181
[5 Debug 18:50:16.632] TimeAdaptor REAL Reload took 0.411173
[1 Debug 18:50:16.784] Loading image took 0.554331
[1 Debug 18:50:20.438] open uri = file:///data/photos/2010/01/15/100_0008.JPG
[1 Debug 18:50:20.837] Loading image took 0.417499
Comment 2 Ruben Vermeersch 2010-07-22 14:38:43 UTC
I added a debug statement for this in git master. Could you test this? Need the output of running it with --debug.
Comment 3 Dave Sill 2010-07-24 14:47:02 UTC
Here you go:


** Running f-spot in Debug Mode **
** Running Mono with --debug   **
[1 Info  10:43:26.747] BaseDirectory is now /tmp
[1 Info  10:43:26.752] PhotoDirectory is now /tmp
[1 Info  10:43:26.762] Initializing Mono.Addins
[1 Debug 10:43:26.907] Mono.Addins Initialization took 0.140577
[1 Debug 10:43:27.238] Db Initialization took 0.12362
[1 Debug 10:43:27.625] Query Started : SELECT * FROM photos  WHERE  photos.id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = 2) ORDER BY  time DESC, filename ASC 
[1 Debug 10:43:27.626] QueryToTemp took 0.001506 : SELECT * FROM photos  WHERE  photos.id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = 2) ORDER BY  time DESC, filename ASC 
[1 Debug 10:43:27.626] Reloading the query took 0.006036
[1 Debug 10:43:27.829] Query took 0.015499 : SELECT * FROM photoquery_temp_0 LIMIT 100 OFFSET 0
[2 Debug 10:43:27.857] PhotosPerMonth took 0.005534
[2 Debug 10:43:27.861] TimeAdaptor REAL Reload took 0.213381
[1 Debug 10:43:27.883] Query Started : SELECT * FROM photos  WHERE  photos.id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = 2) ORDER BY  time ASC, filename ASC 
[1 Debug 10:43:27.884] QueryToTemp took 0.001536 : SELECT * FROM photos  WHERE  photos.id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = 2) ORDER BY  time ASC, filename ASC 
[1 Debug 10:43:27.898] Query took 0.001138 : SELECT * FROM photoquery_temp_0 LIMIT 100 OFFSET 0
[1 Debug 10:43:28.027] open uri = file:///tmp/2010/07/13/100_0370.JPG
[1 Debug 10:43:28.050] Reloading the query took 0.168123
[3 Debug 10:43:28.105] PhotosPerMonth took 0.00115
[3 Debug 10:43:28.106] TimeAdaptor REAL Reload took 0.217928
[1 Debug 10:43:28.123] Query Started : SELECT * FROM photos  WHERE  photos.id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = 2) ORDER BY  time ASC, filename ASC 
[1 Debug 10:43:28.124] QueryToTemp took 0.001007 : SELECT * FROM photos  WHERE  photos.id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = 2) ORDER BY  time ASC, filename ASC 
[1 Debug 10:43:28.137] IndexOf took 0.000207 : SELECT ROWID AS row_id FROM photoquery_temp_0 WHERE id = 1
[1 Debug 10:43:28.137] Reloading the query took 0.013541
[1 Debug 10:43:28.279] Query took 0.002847 : SELECT * FROM photoquery_temp_0 LIMIT 100 OFFSET 0
[4 Debug 10:43:28.335] PhotosPerMonth took 0.001488
[4 Debug 10:43:28.335] TimeAdaptor REAL Reload took 0.210389

(f-spot:13020): GdkPixbuf-WARNING **: GdkPixbufLoader finalized without calling gdk_pixbuf_loader_close() - this is not allowed. You must explicitly end the data stream to the loader before dropping the last reference.
[1 Debug 10:43:28.637] Loading image took 0.735891
[1 Warn  10:43:34.423] Caught an exception - System.InvalidOperationException: File not writeable. Corrupt metadata? (in `TagLib')
  at TagLib.Jpeg.File.Save () [0x00047] in /home/dave/development/f-spot/lib/TagLib/TagLib/src/TagLib/Jpeg/File.cs:225 
  at FSpot.RotateOperation.RotateOrientation (System.String original_path, RotateDirection direction) [0x0003c] in /home/dave/development/f-spot/src/RotateCommand.cs:70 
[1 Debug 10:43:37.238] open uri = file:///tmp/2010/07/13/100_0370.JPG
[1 Debug 10:43:37.679] Loading image took 0.452752
Comment 4 Henry Gomersall 2010-09-09 14:04:06 UTC
This really breaks normal usage. Is there some motivation to fix it?

What further information is required?

I'm happy to help...
Comment 5 Henry Gomersall 2010-09-09 15:17:50 UTC
Created attachment 169865 [details]
Image the rotates fine in F-Spot
Comment 6 Henry Gomersall 2010-09-09 15:18:56 UTC
Created attachment 169866 [details]
Breaks the rotation tool in F-Spot

Further investigation shows that the problem seems to be specific to photos that come of my new camera. Modifying the file in GIMP and unchecking the "save EXIF data" option does not solve the problem.

Attached are 2 test images. One taken on my mobile phone that works fine, one taken on my digital camera that fails to rotate.
Comment 7 Ruben Vermeersch 2010-09-11 20:22:31 UTC
I think this is because we don't handle PossiblyCorrupt cases while writing the rotation. Will investigate.
Comment 8 Holger Mauermann 2010-09-12 18:14:38 UTC
Same problem here since upgrading to f-spot 0.7.x with image files from a two years old Casio EX-Z1080. Rotating its images works fine with f-spot 0.6.x
Comment 9 Ruben Vermeersch 2010-09-13 08:24:16 UTC
Created attachment 170118 [details] [review]
Make sure metadata write on rotate also works for broken files.
Comment 10 Ruben Vermeersch 2010-09-13 08:38:15 UTC
Created attachment 170119 [details] [review]
Make sure metadata write on rotate also works for broken files.
Comment 11 Ruben Vermeersch 2010-09-13 08:39:41 UTC
Attachment 170119 [details] pushed as 485c1ff - Make sure metadata write on rotate also works for broken files.

Should be fixed now, rotating is enabled for all files, even ones for which we can't write metadata (using an XMP sidecar).
Comment 12 Henry Gomersall 2010-09-19 12:25:38 UTC
I'm not sure if this is related to this bug, but uploads to Flickr are still not rotated correctly (although the rotation within f-spot works fine now).