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 356118 - NullReference exception during import
NullReference exception during import
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: General
CVS
Other Linux
: Normal major
: ---
Assigned To: F-spot maintainers
F-spot maintainers
Depends on:
Blocks:
 
 
Reported: 2006-09-15 12:23 UTC by Bengt Thuree
Modified: 2007-07-28 09:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test picture that causes this fault (54.54 KB, image/jpeg)
2006-09-15 12:24 UTC, Bengt Thuree
  Details
Patch for NullReference exception during import (2.89 KB, patch)
2006-09-21 05:22 UTC, Bengt Thuree
none Details | Review

Description Bengt Thuree 2006-09-15 12:23:35 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]
Comment 1 Bengt Thuree 2006-09-15 12:24:32 UTC
Created attachment 72850 [details]
test picture that causes this fault
Comment 2 Larry Ewing 2006-09-20 16:51:57 UTC
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.
Comment 3 Bengt Thuree 2006-09-21 02:48:57 UTC
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.
Comment 4 Bengt Thuree 2006-09-21 05:22:18 UTC
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)
Comment 5 Stephane Delcroix 2007-07-28 09:46:02 UTC
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