GNOME Bugzilla – Bug 645672
Exception while importing Canon .CR2 along with .xmp file
Last modified: 2018-07-01 08:59:09 UTC
F-Spot fails to import a .CR2 Canon raw image with .xmp file produced by Adobe Lightroom. Distribution: Ubuntu 10.10 Steps to reproduce: - Download two attached files into same directory - Try to import selecting that directory Actual results: The image isn't imported and the corresponding message is displayed. Expected results: The image is imported with metadata from the .xmp file (I believe). No error is displayed. Additional Information: The GIT version just crashes on import. Also crash is caused by previewing images to be imported. f-spot --view doesn't show the image. And so on. Here the output with --debug switch: ** Running f-spot in Debug Mode ** ** Running Mono with --debug ** [1 Info 23:55:34.072] Initializing Mono.Addins [1 Debug 23:55:35.820] Mono.Addins Initialization took 1.721956 [1 Debug 23:55:36.329] Db Initialization took 0.151813 [1 Debug 23:55:36.781] 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 23:55:36.783] QueryToTemp took 0.00161 : 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 23:55:36.783] Reloading the query took 0.005897 [2 Debug 23:55:37.009] PhotosPerMonth took 0.000987 [2 Debug 23:55:37.011] TimeAdaptor REAL Reload took 0.208837 [1 Debug 23:55:37.135] 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 23:55:37.136] QueryToTemp took 0.001436 : 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 23:55:37.188] Reloading the query took 0.053959 [3 Debug 23:55:37.341] PhotosPerMonth took 0.001055 [3 Debug 23:55:37.341] TimeAdaptor REAL Reload took 0.201967 [1 Debug 23:55:50.719] Received controller event: SourceChanged [1 Debug 23:55:50.734] Received controller event: PhotoScanStarted [1 Debug 23:55:50.933] Invalid thumbnail, reloading: file:///home/steve/tmp/1/IMG_0799.CR2 [1 Warn 23:55:51.085] Caught an exception - System.NullReferenceException: Object reference not set to an instance of an object (in `FSpot.Utils') at FSpot.Utils.SidecarXmpExtensions.ParseXmpSidecar (TagLib.Image.File file, IFileAbstraction resource) [0x00000] in <filename unknown>:0 at FSpot.Utils.Metadata.Parse (Hyena.SafeUri uri) [0x00000] in <filename unknown>:0 at FSpot.Imaging.BaseImageFile..ctor (Hyena.SafeUri uri) [0x00000] in <filename unknown>:0 at FSpot.Imaging.Cr2File..ctor (Hyena.SafeUri uri) [0x00000] in <filename unknown>:0 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] in <filename unknown>:0 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. (in `mscorlib') at System.Reflection.MonoCMethod.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.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0 at System.Activator.CreateInstance (System.Type type, System.Object[] args, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0 at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <filename unknown>:0 at FSpot.Imaging.ImageFile.Create (Hyena.SafeUri uri) [0x00000] in <filename unknown>:0 [1 Warn 23:55:51.086] Caught an exception - System.NullReferenceException: Object reference not set to an instance of an object (in `FSpot.Utils') at FSpot.Utils.SidecarXmpExtensions.ParseXmpSidecar (TagLib.Image.File file, IFileAbstraction resource) [0x00000] in <filename unknown>:0 at FSpot.Utils.Metadata.Parse (Hyena.SafeUri uri) [0x00000] in <filename unknown>:0 at FSpot.Imaging.BaseImageFile..ctor (Hyena.SafeUri uri) [0x00000] in <filename unknown>:0 at FSpot.Imaging.Cr2File..ctor (Hyena.SafeUri uri) [0x00000] in <filename unknown>:0 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] in <filename unknown>:0 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. (in `mscorlib') at System.Reflection.MonoCMethod.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.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0 at System.Activator.CreateInstance (System.Type type, System.Object[] args, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0 at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <filename unknown>:0 at FSpot.Imaging.ImageFile.Create (Hyena.SafeUri uri) [0x00000] in <filename unknown>:0 [1 Debug 23:55:51.087] Received controller event: PhotoScanFinished [4 Debug 23:55:52.669] Failed to import file:///home/steve/tmp/1/IMG_0799.CR2 [4 Warn 23:55:52.670] Caught an exception - System.NullReferenceException: Object reference not set to an instance of an object (in `FSpot.Utils') at FSpot.Utils.SidecarXmpExtensions.ParseXmpSidecar (TagLib.Image.File file, IFileAbstraction resource) [0x00000] in <filename unknown>:0 at FSpot.Utils.Metadata.Parse (Hyena.SafeUri uri) [0x00000] in <filename unknown>:0 at FSpot.Core.FilePhoto.EnsureMetadataParsed () [0x00000] in <filename unknown>:0 at FSpot.Core.FilePhoto.get_Time () [0x00000] in <filename unknown>:0 at FSpot.Import.ImportController.FindImportDestination (IPhoto item) [0x00000] in <filename unknown>:0 at FSpot.Import.ImportController.ImportPhoto (IPhoto item, FSpot.Core.Roll roll) [0x00000] in <filename unknown>:0 at FSpot.Import.ImportController.DoImport () [0x00000] in <filename unknown>:0 [1 Debug 23:55:52.696] Received controller event: ImportStarted [1 Debug 23:55:52.697] Received controller event: ImportFinished [1 Info 23:55:58.699] Exiting...
This is stacktrace for --view operation. FSpot.Utils.SidecarXmpExtensions.ParseXmpSidecar (file={TagLib.Tiff.Cr2.File}, resource={FSpot.Utils.GIOTagLibFileAbstraction}) in /home/steve/tmp/f-spot/src/Core/FSpot.Utils/FSpot.Utils/SidecarXmpExtensions.cs:72 FSpot.Utils.Metadata.Parse (uri={file:///home/steve/tmp/1/IMG_0799.CR2}) in /home/steve/tmp/f-spot/src/Core/FSpot.Utils/FSpot.Utils/Metadata.cs:80 FSpot.Imaging.BaseImageFile..ctor (uri={file:///home/steve/tmp/1/IMG_0799.CR2}) in /home/steve/tmp/f-spot/src/Clients/MainApp/FSpot.Imaging/ImageFile.cs:226 FSpot.Imaging.Cr2File..ctor (uri={file:///home/steve/tmp/1/IMG_0799.CR2}) in /home/steve/tmp/f-spot/src/Clients/MainApp/FSpot.Imaging/Tiff.cs System.Reflection.MonoCMethod.Invoke (obj=(null), invokeAttr=System.Reflection.BindingFlags.Instance|System.Reflection.BindingFlags.Public, binder={System.Reflection.Binder.Default}, parameters={object[1]}, culture=(null)) in System.Reflection.MonoCMethod.Invoke (invokeAttr=System.Reflection.BindingFlags.Instance|System.Reflection.BindingFlags.Public, binder={System.Reflection.Binder.Default}, parameters={object[1]}, culture=(null)) in System.Activator.CreateInstance (type={FSpot.Imaging.Cr2File}, bindingAttr=System.Reflection.BindingFlags.Instance|System.Reflection.BindingFlags.Public, binder={System.Reflection.Binder.Default}, args={object[1]}, culture=(null), activationAttributes={object[0]}) in System.Activator.CreateInstance (type={FSpot.Imaging.Cr2File}, args={object[1]}, activationAttributes={object[0]}) in System.Activator.CreateInstance (type={FSpot.Imaging.Cr2File}, args={object[1]}) in FSpot.Imaging.ImageFile.Create (uri={file:///home/steve/tmp/1/IMG_0799.CR2}) in /home/steve/tmp/f-spot/src/Clients/MainApp/FSpot.Imaging/ImageFile.cs:166 FSpot.Loaders.GdkImageLoader.Load (uri={file:///home/steve/tmp/1/IMG_0799.CR2}) in /home/steve/tmp/f-spot/src/Clients/MainApp/FSpot.Loaders/GdkImageLoader.cs:71 FSpot.Widgets.PhotoImageView.Load (uri={file:///home/steve/tmp/1/IMG_0799.CR2}) in /home/steve/tmp/f-spot/src/Clients/MainApp/FSpot.Widgets/PhotoImageView.cs:206 FSpot.Widgets.PhotoImageView.HandlePhotoItemChanged (sender={FSpot.Core.BrowsablePointer}, args={FSpot.Core.BrowsablePointerChangedEventArgs}) in /home/steve/tmp/f-spot/src/Clients/MainApp/FSpot.Widgets/PhotoImageView.cs:339 FSpot.Core.BrowsablePointer.SetIndex (value=0, changes=(null)) in /home/steve/tmp/f-spot/src/Core/FSpot.Core/FSpot.Core/BrowsablePointer.cs:142 FSpot.Core.BrowsablePointer.HandleCollectionChanged (collection={FSpot.UriCollection}) in /home/steve/tmp/f-spot/src/Core/FSpot.Core/FSpot.Core/BrowsablePointer.cs:162 FSpot.Core.PhotoList.Reload () in /home/steve/tmp/f-spot/src/Core/FSpot.Core/FSpot.Core/PhotoList.cs:103 FSpot.Core.PhotoList.Add (items={FSpot.Core.FilePhoto[1]}) in /home/steve/tmp/f-spot/src/Core/FSpot.Core/FSpot.Core/PhotoList.cs:72 FSpot.UriCollection+DirectoryLoader+<InfoLoaded>c__AnonStorey17.<>m__6E () in /home/steve/tmp/f-spot/src/Clients/MainApp/FSpot/UriCollection.cs:156 Hyena.ThreadAssist.ProxyToMain (handler={Hyena.InvokeHandler}) in /home/steve/tmp/f-spot/lib/Hyena/Hyena/Hyena/ThreadAssist.cs:103 FSpot.UriCollection+DirectoryLoader.InfoLoaded (o={GLib.Object}, res={GLib.SimpleAsyncResult}) in /home/steve/tmp/f-spot/src/Clients/MainApp/FSpot/UriCollection.cs:155 GLibSharp.AsyncReadyCallbackWrapper.NativeCallback (source_object=0x16d5220, res=0x1835760, user_data=0x0) in /home/steve/tmp/f-spot/lib/gio-sharp/gio/generated/GLibSharp.AsyncReadyCallbackNative.cs:54 Gtk.Application.Run () in FSpot.Driver.Startup () in /home/steve/tmp/f-spot/src/Clients/MainApp/FSpot/main.cs:390 Hyena.Gui.CleanRoomStartup.Startup (startup={Hyena.Gui.CleanRoomStartup.StartupInvocationHandler}) in /home/steve/tmp/f-spot/lib/Hyena/Hyena.Gui/Hyena.Gui/CleanRoomStartup.cs:54 FSpot.Driver.Main (args={string[3]}) in /home/steve/tmp/f-spot/src/Clients/MainApp/FSpot/main.cs:308 The file.GetTag (TagLib.TagTypes.XMP, true) returns null and there is no null-reference checking (probably because with "true" as second parameter GetTag is supposed to create the tag). Still the GetTag's ``(type & ImageTag.AllowedTypes) == 0'' condition is met, and it returns null. I suppose that means that the specified tag cannot be crated for the image type (why?), still I'm not that good in image handling to be sure...
Failed to attach the file, too big... Here's a link to GDocs: https://docs.google.com/leaf?id=0B7LzZGrKL1i4ZTA4YWM4ZWMtMjdhZC00ZDliLTk3ODAtZmQzNzdkM2E3M2U2&hl=en
Specifying XMP as a valid tag for Cr2 fixes the --view behavior (see the attachment). Still the GIT version crashes on import.
Created attachment 184248 [details] [review] "git patch" output
f-spot is not under active development anymore, has not seen code changes for five years, and saw its last tarball release in the year 2010. Its codebase has been archived: https://gitlab.gnome.org/Archive/f-spot/commits/master Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Please feel free to reopen this ticket (or rather transfer the project to GNOME Gitlab, as GNOME Bugzilla is deprecated) if anyone takes the responsibility for active development again.