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 356117 - Exception (Short Read) during import
Exception (Short Read) during import
Status: RESOLVED WONTFIX
Product: f-spot
Classification: Other
Component: General
CVS
Other Linux
: Normal minor
: ---
Assigned To: F-spot maintainers
F-spot maintainers
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2006-09-15 12:20 UTC by Bengt Thuree
Modified: 2018-07-01 08:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
picture that causes this exception (806.35 KB, image/jpeg)
2006-09-15 12:22 UTC, Bengt Thuree
  Details
A small patch with a customized exception when read=0 (2.96 KB, patch)
2006-09-21 12:57 UTC, Bengt Thuree
none Details | Review
A small updated patch with a customized exception when read=0 (2.93 KB, patch)
2006-09-21 13:10 UTC, Bengt Thuree
needs-work Details | Review

Description Bengt Thuree 2006-09-15 12:20:44 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]
Comment 1 Bengt Thuree 2006-09-15 12:22:57 UTC
Created attachment 72849 [details]
picture that causes this exception
Comment 2 Larry Ewing 2006-09-19 16:03:40 UTC
This is a non fatal error right?
Comment 3 Bengt Thuree 2006-09-20 11:50:59 UTC
Nope, it looks ok.
I do get 4 short read Exceptions though when I import this photo.
Comment 4 Bengt Thuree 2006-09-21 05:38:19 UTC
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
Comment 5 Bengt Thuree 2006-09-21 05:42:39 UTC
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?
Comment 6 Bengt Thuree 2006-09-21 12:06:25 UTC
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?
Comment 7 Bengt Thuree 2006-09-21 12:57:47 UTC
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.
Comment 8 Bengt Thuree 2006-09-21 13:10:30 UTC
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
Comment 9 Larry Ewing 2006-12-01 22:40:21 UTC
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.
Comment 10 Bengt Thuree 2007-11-21 20:59:52 UTC
Changing severity to Minor, since the photo is imported...
Comment 11 André Klapper 2018-07-01 08:56:29 UTC
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.