GNOME Bugzilla – Bug 629386
Can not import from digital camera
Last modified: 2010-09-13 09:09:09 UTC
Camera is Canon EOS 40D. OS is Linux Ubuntu 10.04 with latest updates. Camera is connected. I start f-spot, choose import, select camera, f-spot closes after a while. Here is complete debug output: ikriznar@Ike-CSL:~$ f-spot --debug ** Running f-spot in Debug Mode ** ** Running Mono with --debug ** [1 Info 01:14:22.034] Initializing Mono.Addins [1 Debug 01:14:22.265] Mono.Addins Initialization took 0.215695 [1 Debug 01:14:22.706] Db Initialization took 0.309133 [1 Debug 01:14:23.264] 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 01:14:23.619] QueryToTemp took 0.354875 : 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 01:14:23.619] Reloading the query took 0.357948 [2 Debug 01:14:24.031] PhotosPerMonth took 0.17774 [2 Debug 01:14:24.032] TimeAdaptor REAL Reload took 0.38439 [1 Debug 01:14:24.039] Query took 0.163035 : SELECT * FROM photoquery_temp_0 LIMIT 100 OFFSET 0 [1 Debug 01:14:24.069] 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 01:14:24.370] QueryToTemp took 0.301243 : 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 01:14:24.386] Query took 0.007241 : SELECT * FROM photoquery_temp_0 LIMIT 100 OFFSET 0 [1 Debug 01:14:24.518] open uri = file:///home/ikriznar/Photos/Olimpus 1 2007/P1010122%20Olimpija%2022.JPG [1 Debug 01:14:24.539] Reloading the query took 0.470828 [1 Debug 01:14:24.596] 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 01:14:24.967] QueryToTemp took 0.370548 : 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 01:14:25.063] PhotosPerMonth took 0.487397 [3 Debug 01:14:25.064] TimeAdaptor REAL Reload took 0.096232 [1 Debug 01:14:25.104] IndexOf took 0.015586 : SELECT ROWID AS row_id FROM photoquery_temp_0 WHERE id = 11838 [1 Debug 01:14:25.104] Reloading the query took 0.507361 [1 Debug 01:14:25.269] Query took 0.010665 : SELECT * FROM photoquery_temp_0 LIMIT 100 OFFSET 0 [4 Debug 01:14:25.371] PhotosPerMonth took 0.203358 [4 Debug 01:14:25.371] TimeAdaptor REAL Reload took 0.403981 [1 Debug 01:14:25.490] Loading image took 1.102561 [1 Debug 01:14:36.066] Received controller event: SourceChanged [1 Debug 01:14:36.085] Received controller event: PhotoScanStarted [1 Warn 01:14:36.152] Caught an exception - System.NullReferenceException: Object reference not set to an instance of an object (in `f-spot') at FSpot.Loaders.ImageLoader.Create (Hyena.SafeUri uri) [0x00007] in /home/install/f-spot-0.7.3/src/Clients/MainApp/FSpot.Loaders/ImageLoader.cs:45 at FSpot.Widgets.PhotoImageView.Load (Hyena.SafeUri uri) [0x00021] in /home/install/f-spot-0.7.3/src/Clients/MainApp/FSpot.Widgets/PhotoImageView.cs:181 at FSpot.Widgets.PhotoImageView.HandlePhotoItemChanged (System.Object sender, FSpot.Core.BrowsablePointerChangedEventArgs args) [0x0012b] in /home/install/f-spot-0.7.3/src/Clients/MainApp/FSpot.Widgets/PhotoImageView.cs:318 [5 Debug 01:14:36.163] Invalid thumbnail, reloading: gphoto2://[usb:002,050]/DCIM/100CANON/IMG_9925.JPG [1 Debug 01:14:37.086] Loading of metadata failed for file: gphoto2://[usb:002,050]/DCIM/100CANON/IMG_9925.JPG, trying extension fallback [5 Debug 01:14:37.546] Loading of metadata failed for file: gphoto2://[usb:002,050]/DCIM/100CANON/IMG_9925.JPG, trying extension fallback [1 Debug 01:14:38.003] Loading of metadata failed for file: gphoto2://[usb:002,050]/DCIM/100CANON/IMG_9925.JPG [1 Warn 01:14:38.004] Caught an exception - GLib.GException: Operation not supported by backend (in `gio-sharp') at GLib.FileInputStream.QueryInfo (System.String attributes, GLib.Cancellable cancellable) [0x00000] at GLib.GioStream.get_Length () [0x00000] at TagLib.File.get_Length () [0x00000] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/File.cs:379 at TagLib.IFD.IFDReader.ReadIFD (Int64 base_offset, UInt32 offset, UInt32 max_offset) [0x00000] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:264 at TagLib.IFD.IFDReader.Read (Int32 count) [0x00048] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:183 at TagLib.IFD.IFDReader.Read () [0x00000] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:152 at TagLib.Jpeg.File.ReadAPP1Segment (UInt16 length) [0x000d2] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/Jpeg/File.cs:461 at TagLib.Jpeg.File.ReadMetadata () [0x000b6] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/Jpeg/File.cs:374 at TagLib.Jpeg.File.Read (ReadStyle propertiesStyle) [0x0001d] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/Jpeg/File.cs:246 at TagLib.Jpeg.File..ctor (IFileAbstraction abstraction, ReadStyle propertiesStyle) [0x00007] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/Jpeg/File.cs:167 at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] [5 Debug 01:14:38.004] Loading of metadata failed for file: gphoto2://[usb:002,050]/DCIM/100CANON/IMG_9925.JPG [5 Warn 01:14:38.005] Caught an exception - GLib.GException: Operation not supported by backend (in `gio-sharp') at GLib.FileInputStream.QueryInfo (System.String attributes, GLib.Cancellable cancellable) [0x00000] at GLib.GioStream.get_Length () [0x00000] at TagLib.File.get_Length () [0x00000] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/File.cs:379 at TagLib.IFD.IFDReader.ReadIFD (Int64 base_offset, UInt32 offset, UInt32 max_offset) [0x00000] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:264 at TagLib.IFD.IFDReader.Read (Int32 count) [0x00048] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:183 at TagLib.IFD.IFDReader.Read () [0x00000] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/IFD/IFDReader.cs:152 at TagLib.Jpeg.File.ReadAPP1Segment (UInt16 length) [0x000d2] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/Jpeg/File.cs:461 at TagLib.Jpeg.File.ReadMetadata () [0x000b6] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/Jpeg/File.cs:374 at TagLib.Jpeg.File.Read (ReadStyle propertiesStyle) [0x0001d] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/Jpeg/File.cs:246 at TagLib.Jpeg.File..ctor (IFileAbstraction abstraction, ReadStyle propertiesStyle) [0x00007] in /home/install/f-spot-0.7.3/lib/TagLib/TagLib/src/TagLib/Jpeg/File.cs:167 at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] [5 Debug 01:14:38.005] open uri = gphoto2://[usb:002,050]/DCIM/100CANON/IMG_9925.JPG Exception in Gtk# callback delegate Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception. System.NullReferenceException: Object reference not set to an instance of an object at FSpot.Core.FilePhoto.EnsureMetadataParsed () [0x0001d] in /home/install/f-spot-0.7.3/src/Core/FSpot.Core/FSpot.Core/FilePhoto.cs:39 at FSpot.Core.FilePhoto.get_Time () [0x00000] in /home/install/f-spot-0.7.3/src/Core/FSpot.Core/FSpot.Core/FilePhoto.cs:61 at FSpot.Widgets.ThumbnailDateCaptionRenderer.Render (Gdk.Drawable window, Gtk.Widget widget, Rectangle cell_area, Rectangle expose_area, StateType cell_state, IPhoto photo) [0x00028] in /home/install/f-spot-0.7.3/src/Clients/MainApp/FSpot.Widgets/ThumbnailDateCaptionRenderer.cs:63 at FSpot.Widgets.CollectionGridView.DrawPhoto (Int32 cell_num, Rectangle cell_area, Rectangle expose_area, Boolean selected, Boolean focussed) [0x0052d] in /home/install/f-spot-0.7.3/src/Clients/MainApp/FSpot.Widgets/CollectionCellGridView.cs:446 at FSpot.Widgets.BrowseablePointerGridView.DrawPhoto (Int32 cell_num, Rectangle cell_area, Rectangle expose_area, Boolean selected, Boolean focussed) [0x00000] in /home/install/f-spot-0.7.3/src/Clients/MainApp/FSpot.Widgets/BrowseablePointerGridView.cs:63 at FSpot.Widgets.CollectionGridView.DrawCell (Int32 cell_num, Rectangle cell_area, Rectangle expose_area) [0x00000] in /home/install/f-spot-0.7.3/src/Clients/MainApp/FSpot.Widgets/CollectionCellGridView.cs:306 at FSpot.Widgets.CellGridView.DrawAllCells (Rectangle area) [0x00019] in /home/install/f-spot-0.7.3/src/Core/FSpot.Gui/FSpot.Widgets/CellGridView.cs:430 at FSpot.Widgets.CellGridView.OnExposeEvent (Gdk.EventExpose args) [0x00020] in /home/install/f-spot-0.7.3/src/Core/FSpot.Gui/FSpot.Widgets/CellGridView.cs:351 at Gtk.Widget.exposeevent_cb (IntPtr widget, IntPtr evnt) [0x00000] at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal) at Gtk.Widget.exposeevent_cb(IntPtr widget, IntPtr evnt) at Gdk.Window.gdk_window_process_updates(IntPtr , Boolean ) at Gdk.Window.ProcessUpdates(Boolean update_children) at FSpot.Widgets.CellGridView.SetSize(Int32 x, Int32 y, Int32 width, Int32 height) in /home/install/f-spot-0.7.3/src/Core/FSpot.Gui/FSpot.Widgets/CellGridView.cs:line 423 at FSpot.Widgets.CellGridView.UpdateLayout(Rectangle allocation) in /home/install/f-spot-0.7.3/src/Core/FSpot.Gui/FSpot.Widgets/CellGridView.cs:line 389 at FSpot.Widgets.CellGridView.OnSizeAllocated(Rectangle allocation) in /home/install/f-spot-0.7.3/src/Core/FSpot.Gui/FSpot.Widgets/CellGridView.cs:line 335 at Gtk.Widget.sizeallocated_cb(IntPtr widget, IntPtr allocation) at Gtk.Application.gtk_main() at Gtk.Application.Run() at FSpot.Driver.Startup() in /home/install/f-spot-0.7.3/src/Clients/MainApp/FSpot/main.cs:line 356 at Hyena.Gui.CleanRoomStartup.Startup(Hyena.Gui.StartupInvocationHandler startup) in /home/install/f-spot-0.7.3/lib/Hyena/Hyena.Gui/Hyena.Gui/CleanRoomStartup.cs:line 54 at FSpot.Driver.Main(System.String[] args) in /home/install/f-spot-0.7.3/src/Clients/MainApp/FSpot/main.cs:line 273 [6 Debug 01:14:38.469] Finalizer called on FSpot.Core.Tag. Should be Disposed [6 Debug 01:14:38.469] Finalizer called on FSpot.Database.Db. Should be Disposed [6 Debug 01:14:38.471] Finalizer called on FSpot.Utils.DisposableCache`2[System.String,Gdk.Pixbuf]. Should be Disposed ikriznar@Ike-CSL:~$
I have reverted to 0.7.0, import worked OK.
Created attachment 170120 [details] [review] Make IFD parsing slightly more robust. Not all IO backends support finding the length of a stream. I relaxed the safety check slightly to fall back to using the max length of a TIFF file as per the specification: 4 gigabyte.
Created attachment 170121 [details] [review] Be sligthly more resilient to metadata parsing failures.
Added two fixes to solve this bug. Should work now.