Tk Library Source Code

View Ticket
Login
Ticket UUID: 1028668
Title: exif -- make field(19) optional
Type: Patch Version: None
Submitter: kot Created on: 2004-09-15 16:33:03
Subsystem: None Assigned To: nobody
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2004-09-30 05:18:56
Resolution: Fixed Closed By: andreas_kupries
    Closed on: 2004-09-29 22:18:56
Description:
Our old Canon PowerShot S100 camera generates files, 
which cause the following error from exif::analyze: 
 
can't read "field(19)": no such element in array 
% set errorInfo 
can't read "field(19)": no such element in array 
    while executing 
"expr {$field(19)-0x3000}" 
    (procedure "makerNote" line 130) 
    invoked from within 
"makerNote $data $offset" 
    (procedure "exifSubIFD" line 18) 
    invoked from within 
"exifSubIFD $data $offset" 
    (procedure "app1" line 62) 
    invoked from within 
"app1 $data $thumbnail" 
    (procedure "exif::analyze" line 30) 
    invoked from within 
"exif::analyze file7" 
    ("uplevel" body line 1) 
    invoked from within 
"uplevel #0 {exif::analyze file7}" 
 
The attached patch makes the code check for the presence 
of field(19) prior to using it.
User Comments: andreas_kupries added on 2004-09-30 05:18:56:
Logged In: YES 
user_id=75003

committed the fix to head. Place holder for the test image
right now, have to cut it down a bit, 600K is not manageable.

andreas_kupries added on 2004-09-16 03:10:36:
Logged In: YES 
user_id=75003

Right.

kot added on 2004-09-16 00:24:32:
Logged In: YES 
user_id=173641

Ooops, there is TclMagick already!

http://www.graphicsmagick.org/TclMagick/

kot added on 2004-09-16 00:22:46:
Logged In: YES 
user_id=173641

Regarding JPEG manipulation. The way, jpegtran does(1)
_lossless_ rotation is exactly through manipulating the data
chunks. Decoding the image, rotating, and encoding it back
is how everything else does it, which leads to loss in image
quality. Rotation by 90, 180, and 270 degrees can be done
without re-encoding, quickly, and losslessly.

In general, I'd like to see TCL interface to ImageMagick's
or GraphicsMagick's libMagick -- with and without the Tk
support (photo(n)).

andreas_kupries added on 2004-09-16 00:12:38:
Logged In: YES 
user_id=75003

Thank you. I got the image now, and will try to compress it
a bit more. 600K is still a bit big to be lugged arund as a
testcase in the distribution. I hope you don't mind getting
more squeezed and blurry :)

Alas, the jpeg code in tcllib is currently only able to work
on a number of meta data chunks, like timestamps, comments,
exif, etc. It has no operations for manipulating the pixels,
like higher compression, rotation, and the like. However if
someone writes such methods I would be willing to include them.

See http://tcllib.sourceforge.net/doc/index.html#DIVnode290
for the documentation.

kot added on 2004-09-16 00:02:47:
Logged In: YES 
user_id=173641

Try this picture of yours truly (above, right) for example:

http://virtual-estates.net/Izrail/Ira/img_4060.jpg

BTW, I'm thrilled to learn, there is wider JPEG support in
the works, than just Exif-handling.

In particular, it appears, no software out there provides
for lossless rotation of JPEG images (besides the jpegtran
part of libjpeg). It would be great, if tcllib was the first
to offer this valuable feature.

andreas_kupries added on 2004-09-15 23:47:35:
Logged In: YES 
user_id=75003

Thanks. Can you please also try the exif functionality in
the jpeg module/package ? For this you will need the Tcllib
CVS Head.

Note: Is it possible for you to create a jpeg file without
or minimal image data which has the same exif data which is
giving you the trouble ? I would like to have something like
that as test case.

... Belay the query about jpeg::exif ... I just see from the
stacktrace that this happens in the MakerNote decoder of
exif, and Makernote data is not yet handled by the
jpeg::exif code. I would still like to have an image showing
the error for a testcase.

kot added on 2004-09-15 23:33:05:

File Added - 101598: exif.patch

Attachments: