f-spot crashes when image has wrong date

Bug #653327 reported by everflux
58
This bug affects 10 people
Affects Status Importance Assigned to Milestone
F-Spot
Unknown
Medium
f-spot (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: f-spot

f-spot crashes when the gallery contains an image which has an invalid date. f-spot can not be started / crashes on each start.
This should be handled and not result in an application crash.

Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
System.ArgumentOutOfRangeException: Argument is out of range.
  at System.DateTime.DaysInMonth (Int32 year, Int32 month) [0x00000] in <filename unknown>:0
  at FSpot.TimeAdaptor.DateFromIndexDescending (Int32 item) [0x00000] in <filename unknown>:0
  at FSpot.TimeAdaptor.DateFromIndex (Int32 item) [0x00000] in <filename unknown>:0
  at FSpot.TimeAdaptor.TickLabel (Int32 item) [0x00000] in <filename unknown>:0
  at FSpot.GroupSelector.HandleAdaptorChanged (FSpot.GroupAdaptor adaptor) [0x00000] in <filename unknown>:0
  at (wrapper delegate-invoke) FSpot.GroupAdaptor/ChangedHandler:invoke_void__this___GroupAdaptor (FSpot.GroupAdaptor)
  at FSpot.TimeAdaptor+<DoReload>c__AnonStorey19.<>m__6B () [0x00000] in <filename unknown>:0
  at FSpot.Driver+<RunIdle>c__AnonStorey11.<>m__50 () [0x00000] in <filename unknown>:0
  at GLib.Idle+IdleProxy.Handler () [0x00000] in <filename unknown>:0
   at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal)
   at GLib.Idle+IdleProxy.Handler()
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at FSpot.Driver.Startup()
   at Hyena.Gui.CleanRoomStartup.Startup(Hyena.Gui.StartupInvocationHandler startup)
   at FSpot.Driver.Main(System.String[] args)

Revision history for this message
Pedro Villavicencio (pedro) wrote :

could you attach that image to the report? thanks.

Changed in f-spot (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
everflux (tklaunchpad) wrote :

I really would like to, but even though I searched I could not identify the offending image.
From the stacktrace when run with "-v" it looks like f-spot DOES detect that the meta data looks bogus, but then does not handle the situation fully:

$ f-spot -verbose
[Info 01:02:03.718] Initializing Mono.Addins
[Warn 01:02:06.365] Metadata of file file:///.,,/DSCN0140-1.jpg may be corrupt, refusing to write to it, falling back to XMP sidecar.
Exception in Gtk# callback delegate....

then removing the file stated above:

$ f-spot -verbose
[Info 01:05:21.965] Initializing Mono.Addins
Exception in Gtk# callback delegate...

I could not triage which image/database entry leads to the crash, while the above mentioned image imported cleanly on a separate machine. (All machines running maverick 10.10, current f-spot)

Revision history for this message
Guillaume Lanquepin-Chesnais (guyomel) wrote :
Download full text (11.9 KiB)

I get similary errors when I import picture. First, when I import:

[1 Debug 14:32:09.604] Received controller event: ImportFinished
Marshaling destroy signal
Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at FSpot.Widgets.CollectionGridView.OnDestroyed () [0x00000] in <filename unknown>:0
  at Gtk.Object.NativeDestroy (System.Object o, System.EventArgs args) [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <filename unknown>:0
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0
   at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal)
   at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
   at Gtk.Object.gtk_object_destroy(IntPtr )
   at Gtk.Object.Destroy()
   at Gtk.Widget.Destroy()
   at FSpot.UI.Dialog.ImportDialog.OnControllerStatusEvent(ImportEvent evnt)
   at FSpot.Import.ImportController+ImportEventHandler.invoke_void__this___ImportEvent(ImportEvent )
   at FSpot.Import.ImportController+<FireEvent>c__AnonStorey8.<>m__24()
   at FSpot.Driver+<RunIdle>c__AnonStorey11.<>m__50()
   at GLib.Idle+IdleProxy.Handler()
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at FSpot.Driver.Startup()
   at Hyena.Gui.CleanRoomStartup.Startup(Hyena.Gui.StartupInvocationHandler startup)
   at FSpot.Driver.Main(System.String[] args)

Then when I run after import:

[1 Info 14:33:10.650] Initializing Mono.Addins
[1 Debug 14:33:10.874] Mono.Addins Initialization took 0,205211
[1 Debug 14:33:11....

Revision history for this message
Paul McGarry (paul-paulmcgarry) wrote :
Download full text (9.9 KiB)

I am experiencing the same problem, which I think stems from an import attempt thinking some files had a date 0f 01/01/0001.

If I look in my photos dir now there it looks like:

paulm@noobuntu:~/Photos$ ls -l
total 20
drwxr-xr-x 3 paulm paulm 4096 2010-10-13 19:41 1
drwxr-xr-x 5 paulm paulm 4096 2008-12-28 11:56 2007
drwxr-xr-x 8 paulm paulm 4096 2009-11-23 11:29 2008
drwxr-xr-x 11 paulm paulm 4096 2009-12-20 10:27 2009
drwxr-xr-x 9 paulm paulm 4096 2010-10-02 15:44 2010

paulm@noobuntu:~/Photos$ tree 1
1
`-- 01
    `-- 01
        |-- IMG_3048.CR2
        |-- IMG_3049.CR2
        |-- IMG_3050.CR2
etc

The exif data on the file doesn't seem to contain anything to suggest why F-spot chose that date for the files, eg:

paulm@noobuntu:~/Photos$ exiftool 1/01/01/IMG_3147.CR2
ExifTool Version Number : 8.15
File Name : IMG_3147.CR2
Directory : 1/01/01
File Size : 11 MB
File Modification Date/Time : 2010:07:17 09:30:18+10:00
File Permissions : rw-r--r--
File Type : CR2
MIME Type : image/x-raw
Exif Byte Order : Little-endian (Intel, II)
Image Width : 3456
Image Height : 2304
Bits Per Sample : 8 8 8
Compression : JPEG (old-style)
Make : Canon
Camera Model Name : Canon EOS 350D DIGITAL
Preview Image Start : 9728
Orientation : Horizontal (normal)
Preview Image Length : 4040422
X Resolution : 72
Y Resolution : 72
Resolution Unit : inches
Modify Date : 2010:07:17 10:30:14
Exposure Time : 1/125
F Number : 5.6
Exposure Program : Program AE
ISO : 1600
Exif Version : 0221
Date/Time Original : 2010:07:17 10:30:14
Create Date : 2010:07:17 10:30:14
Components Configuration : -, -, -, -
Shutter Speed Value : 1/125
Aperture Value : 5.6
Flash : Off, Did not fire
Focal Length : 270.0 mm
Macro Mode : Normal
Self Timer : Off
Quality : RAW
Canon Flash Mode : Off
Continuous Drive : Continuous
Focus Mode : One-shot AF
Record Mode : CR2+JPEG
Canon Image Size : Unknown (-1)
Easy Mode : Manual
Digital Zoom : None
Contrast : +1
Saturation : +1
Sharpness : +1
Metering Mode : Evaluative
Focus Range : Not Known
Canon Exposure Mode : Program AE
Lens Type : Unknown (-1)
Long Focal : 300 mm
Short Focal : 70 mm
Focal Units : 1/mm
Flash Activity : 0
Flash Bits : (no...

Revision history for this message
Paul McGarry (paul-paulmcgarry) wrote :

The underlying import problem seems to be something to do with raw files, as the jpeg versions of the files imported at the same time seem to have been imported correctly, from a dump of the photos.db:

INSERT INTO "photos" VALUES(6042,-62135636400,'file:///home/paulm/Photos/1/01/01','IMG_3149.CR2','',43,1,0);
INSERT INTO "photos" VALUES(6043,1279323047,'file:///home/paulm/Photos/2010/07/17','IMG_3149.JPG','',43,1,0);

Presumably it's the negative "time" value in the second field that is causing the problem.

FWIW I have got my f-spot working again by deleting the records for the effected photos from the sqlite db, ie:

paulm@noobuntu:~/.config/f-spot$ sqlite3 photos.db
SQLite version 3.7.2
Enter ".help" for instructions
sqlite> select * from photos where id=6044;
6044|-62135636400|file:///home/paulm/Photos/1/01/01|IMG_3150.CR2||43|1|0
sqlite> delete from photos where base_uri='file:///home/paulm/Photos/1/01/01';
sqlite> select * from photos where id=6044;
sqlite> .quit

Revision history for this message
Janne Moren (jan-moren-gmail) wrote :

I don't think it has to do with RAW files. I just got the same issue when trying to import jpeg images from a phone camera. Again, the exif data shows nothing strange. If I strip the exif data from the images before importing it works, of course.

Revision history for this message
YM (yann-michael) wrote :

I am having the same problem trying to import JPG images. exiftool shows nothing strange in the files, but I still get Metadata of file file:///.... may be corrupt, refusing to write to it, falling back to XMP sidecar.

Revision history for this message
OblongCheese (oblongcheese) wrote :

On a fresh install of Ubuntu 10.10 I am having the same problem:

[Info 23:01:07.164] Initializing Mono.Addins
Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
System.ArgumentOutOfRangeException: Argument is out of range.
  at System.DateTime.DaysInMonth (Int32 year, Int32 month) [0x00000] in <filename unknown>:0
  at FSpot.TimeAdaptor.DateFromIndexDescending (Int32 item) [0x00000] in <filename unknown>:0
  at FSpot.TimeAdaptor.DateFromIndex (Int32 item) [0x00000] in <filename unknown>:0
  at FSpot.TimeAdaptor.TickLabel (Int32 item) [0x00000] in <filename unknown>:0
  at FSpot.GroupSelector.HandleAdaptorChanged (FSpot.GroupAdaptor adaptor) [0x00000] in <filename unknown>:0
  at (wrapper delegate-invoke) FSpot.GroupAdaptor/ChangedHandler:invoke_void__this___GroupAdaptor (FSpot.GroupAdaptor)
  at FSpot.TimeAdaptor+<DoReload>c__AnonStorey19.<>m__6B () [0x00000] in <filename unknown>:0
  at FSpot.Driver+<RunIdle>c__AnonStorey11.<>m__50 () [0x00000] in <filename unknown>:0
  at GLib.Idle+IdleProxy.Handler () [0x00000] in <filename unknown>:0
   at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal)
   at GLib.Idle+IdleProxy.Handler()
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at FSpot.Driver.Startup()
   at Hyena.Gui.CleanRoomStartup.Startup(Hyena.Gui.StartupInvocationHandler startup)
   at FSpot.Driver.Main(System.String[] args)

I have simply copied my F-Spot database and corresponding files over from a Ubuntu 10.04 install.

Revision history for this message
komputes (komputes) wrote :

As I can see this bug was marked incomplete at a point where there were no confirmations. The fact that the image cannot be identified does not mean this bug incomplete, however if you are able to find a picture, or a series of steps to generate a picture file which will always be able to reproduce this crash in f-spot, please add it to this bug.

I have liked this to gnome-bugs #633020 upstream and am marking it as confirmed until a direct cause can be found. Once that is done this bug will be marked as triage and ready for developers. Since f-spot can not be started after this crash, I am raising the importance to medium, as this is a severe blocker in a non-core app.

Changed in f-spot (Ubuntu):
importance: Low → Medium
status: Incomplete → Confirmed
Changed in f-spot:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
strangedata (rcteigao) wrote :

All the raw (.ORF) pictures from my camera are giving me this same error. They all show up on import with a date of 1/1/0001 even though the jpegs are OK.

The attached .ORF is an example of a picture with this problem.

Revision history for this message
Mike Rose (mr79) wrote :

FWIW I'm also getting this crash with *all* of my photos taken from my camera. Attached is one image that causes a problem.

Shotwell seems to open the images fine though.

This crash has made f-spot completely and totally unusable for me.

Revision history for this message
strangedata (rcteigao) wrote :

Mike Rose said:
"This crash has made f-spot completely and totally unusable for me."

Yeah, same here. I'm waiting for this problem to be solved because otherwise I can't unload my pictures. Shotwell is not there yet for me (tagging is very different, for instance.)

I'd like to suggest giving this bug a higher priority, since f-spot is right now pretty useless.

Cheers!

Revision history for this message
Mike Rose (mr79) wrote :

Oh, one more thing. My problem is that F-spot crashes on *import* as opposed to importing fine and crashing later (as outlined in the gnone-bugs #633020 here: https://bugzilla.gnome.org/show_bug.cgi?id=633020 )

Basically, I open f-spot, click import, select the directory on the hard drive the photos are in and it crashes before it can even display one thumbnail in the import window.

Interestingly, if I try to import directly from the camera, it will display lots of 'blank' thumbnails in the import screen, all with dates 01/01/0001 and not crash. I am hesitant to go ahead and import these though, in case it does cause f-spot to crash later as obviously f-spot is having a hard time handling these images.

I checked that the import directory I was using that was causing the crash didn't have any strange characters or spaces, in case something wasn't escaped properly, but no dice, the crash still happens regardless of the directory name.

Also, I was able to import jpg files from another camera with no problems, it appears to be confined to this camera/exif-set/file-format only.

F-spot was working perfectly before I upgraded from 10.04 to 10.10. Is there some older version of f-spot i can downgrade to to restore functionality? If so, how do I do this?

Changed in f-spot:
status: New → Unknown
Revision history for this message
strangedata (rcteigao) wrote :

Is it possible do downgrade f-spot on Ubuntu 10.10?

Revision history for this message
strangedata (rcteigao) wrote :

Does anyone know how to export tags from f-spot and import them on digiKam? I don't see other possible workaround at the moment.

Revision history for this message
Tony Whitmore (tonywhitmore) wrote :

I'm seeing this when opening my existing F-spot archive, which has a lot of RAW images in it. Curiously, it only seems to affect the ones taken on my 350D. RAW images from my 5D are fine.

I have also flushed my f-spot configuration and started again and found the JPEG images import fine. The problem occurs when RAW files are introduced. Any more than a couple at a time and the RAM usage and load average just shoots through the roof and the system becomes unresponsive.

The same images weren't a problem under F-spot in 10.04, it seems to be an issue that has occurred since the upgrade to 10.10.

Revision history for this message
OblongCheese (oblongcheese) wrote :

You can fix this problem temporarily by taking the following action:

1. Backup your photos.db, usually located in $HOME/.config/f-spot/photos.db
2. Install sqlite3 (apt-get install sqlite3)
3. Run: sqlite3 $HOME/.config/f-spot/photos.db
4. To find out which files are broken, do: select * from photos where date<0 - this will list all the photos with a negative number as the date (aka corrupt dates)
5. Then do: delete from photos where date<0 - this will delete all records from the database which reference photos with a corrupt date. F-Spot will not work again, but obviously won't have the affected photos in the database.

Revision history for this message
Tony Whitmore (tonywhitmore) wrote :

Thanks for the suggestion Mr. Cheese. Unfortunately, the photos table doesn't have a date column:

tony@bok:~/Photos$ sqlite3 ./photos.db
SQLite version 3.7.2
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select * from photos where date<0;
Error: no such column: date
sqlite> .schema photos
CREATE TABLE photos (
 id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
 time INTEGER NOT NULL,
 base_uri STRING NOT NULL,
 filename STRING NOT NULL,
 description TEXT NOT NULL,
 roll_id INTEGER NOT NULL,
 default_version_id INTEGER NOT NULL,
 rating INTEGER NULL
);

Revision history for this message
Tony Whitmore (tonywhitmore) wrote :

Just to clarify, using the "time" column instead also does not return any photos in my archive which match "time<0". Also, as I'm getting the issue in the import dialogue box, before the images are actually imported, it seems unlikely to be a DB error entirely.

Revision history for this message
Tony Whitmore (tonywhitmore) wrote :

The latest unofficial backport from the F-spot team seems to fix the issue, at least for me: https://launchpad.net/~f-spot/+archive/f-spot-ppa

Revision history for this message
gcc (chris+ubuntu-qwirx) wrote :

I can confirm that this new version fixes the crash on f-spot startup for me.

B Bobo (yout-bobo123)
Changed in f-spot (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.