GNOME Bugzilla – Bug 356118
NullReference exception during import
Last modified: 2007-07-28 09:46:02 UTC
open uri = file:///home/bengt/test-pictures/slask2/psyche179.jpg read = 684 approximate quality = 0 System.NullReferenceException: Object reference not set to an instance of an object at FSpot.JpegFile.get_Description () [0x00000] System.NullReferenceException: Object reference not set to an instance of an object at FSpot.JpegFile.get_ExifData () [0x00000] at FSpot.JpegFile.GetEmbeddedThumbnail () [0x00000] at PhotoStore.GenerateThumbnail (System.Uri uri, FSpot.ImageFile img) [0x00000]
Created attachment 72850 [details] test picture that causes this fault
bengt please make sure you mention if the error is fatal, or if not fatal if it prevents the image from importing, or if everyhting continues to work ok.
Sorry, I wrote this one in a hurry. The photo was imported, but not automatically tagged (I set "test-import" tag during import). All other photos was tagged properly. Can not set a new tag to this photo either because of this error.
Created attachment 73127 [details] [review] Patch for NullReference exception during import This patch fixes two things (problem was both for reading as well as for writing) JpegFile.cs: 1) Get Description : if ExifHeader == null, return null 2) Get Date : if ExifHeader == null, return base.Date 3) Get ExifData : if ( (exif_data == null) || (exif_data.Handle.Handle == System.IntPtr.Zero) ) exif_data = new Exif.ExifData () JpegHeader.cs: 4) Save: only save if (marker.Type >0)
The reported error no longer happens with trunk. And the behavior (tagging on import) with the provided image is the same with or without the patch applied. I guess this was fixed by a previous commit