GNOME Bugzilla – Bug 356117
Exception (Short Read) during import
Last modified: 2018-07-01 08:56:29 UTC
Load Error: open uri = file:///home/bengt/test-pictures/2002/10/20021004_Jasmine_060.JPG read = 6940 approximate quality = 91 Error loading Subdirectory InteroperabilityIfdPointer at 1416 of 1313bytes: System.Exception: Short Read at FSpot.Tiff.Converter.ReadUShort (System.IO.Stream stream, Endian endian) [0x00000] at FSpot.Tiff.ImageDirectory.ReadEntries (System.IO.Stream stream) [0x00000] at FSpot.Tiff.ImageDirectory.Load (System.IO.Stream stream) [0x00000] at FSpot.Tiff.ImageDirectory..ctor (System.IO.Stream stream, UInt32 start_position, Endian endian) [0x00000] at FSpot.Tiff.SubdirectoryEntry.LoadExternal (System.IO.Stream stream) [0x00000]
Created attachment 72849 [details] picture that causes this exception
This is a non fatal error right?
Nope, it looks ok. I do get 4 short read Exceptions though when I import this photo.
Some debug printouts from ReadUShort -- System.Console.WriteLine ("ReadUShort: Read={0}, max={1}", result, tmp.Length); open uri = file:///home/bengt/Photos/2002/10/6/20021004_Jasmine_060-1.JPG ReadUShort: Read=2, max=2 ReadUShort: Read=2, max=2 ReadUShort: Read=0, max=2 Error loading Subdirectory InteroperabilityIfdPointer at 1416 of 1313bytes: System.Exception: Short Read
Perhaps this one should return "No data" or something if 0 bytes was read, and the catch in LoadExternal should just ignore this one, and move on?
Here is a debug trace of an import session... open uri = file:///home/bengt/Photos/2002/10/6/20021004_Jasmine_060.JPG ReadUShort: Read=2, max=2 ReadUShort: Read=2, max=2 ReadUShort: Read=0, max=2 Error loading Subdirectory InteroperabilityIfdPointer at 1416 of 1313bytes: System.Exception: Short Read <snip> (writing xmp part) <snip> open uri = file:///home/bengt/Photos/2002/10/6/20021004_Jasmine_060.JPG read = 3934 approximate quality = 91 ReadUShort: Read=2, max=2 ReadUShort: Read=2, max=2 open uri = file:///home/bengt/Photos/2002/10/6/20021004_Jasmine_060.JPG ---> no more Short Read.... after the xmp part has been written out. So I presume that we can create a new exception for the case when Read=0, and silently ignore this one. Comments anyone?
Created attachment 73139 [details] [review] A small patch with a customized exception when read=0 I came up with a small patch according to my last comment. Created a small exception class, and raised it if Read=0 in ReadUShort as well as in ReadUInt.
Created attachment 73140 [details] [review] A small updated patch with a customized exception when read=0 Same as before, but when catching this exception, print out e.message
I agree we can handle this more gracefully than we currently do but we need to flag the directory as broken so that we can keep the knowledge of a fault when rewriting it.
Changing severity to Minor, since the photo is imported...
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.