On Wed, Apr 22, 2009 at 01:14:29AM -0700, Albrecht Schlosser wrote:
> 
> [STR Closed w/o Resolution]
> 
> Link: http://www.fltk.org/str.php?L2193
> Version: 1.1.9
> Fix Version: Will Not Fix
> 
> 
> Michael Sweet wrote:
> 
> > Fix Version: Will Not Fix
> 
> Are you sure?
> 
> > According to the JPEG File Interchange Format (JFIF) spec, JFIF files
> (what
> > are provided as .jpg or .jpeg) MUST begin with an APPn chunk. See:
> > 
> >     http://www.w3.org/Graphics/JPEG/jfif3.pdf
> 
> I read this so that JFIF is a special case (subset) of the JPEG
> specification.
> 
> > Specifically:
> > 
> >     The syntax of a JFIF file conforms to the syntax for interchange
> >     format defined in Annex B of ISO DIS 10918-1.  In addition, a JFIF
> 
> .....................................................^^^^^^^^^^^^
> 
> >     file uses APP0 marker segments and constrains certain parameters in
> 
> .........................................^^^^^^^^^^
> 
> >     the frame header as defined below. 
> > 
> > So, a file starting with a JPEG comment block does not conform to the
> JFIF
> > spec and cannot be auto-detected as a JPEG file.
> 
> If we do only support the JFIF *subset* ...
> 
> Should we?
> 
> >From the same PDF file:
> 
> "The JPEG File Interchange Format is entirely compatible with the standard
> JPEG interchange format; the only additional requirement is the mandatory
> presence of the APP0 marker right after the SOI marker."
> 
> <End of citation.>
> 
> "The only additional requirement" means for me that this is a requirement
> only for JFIF, but not for JPEG itself.
> 
> If the intention in the original code was to test for JFIF, then it
> should have checked for exactly four bytes and the APP0 marker in the
> fourth byte (and maybe the following "JFIF\0" as well) and not a range.

I think this is because it also want's to accept Exif files
(http://www.Exif.org/specifications.html).
They start like this:

00000000  ff d8 ff e1 3a 3b 45 78  69 66 00 00 4d 4d 00 2a |ÿØÿá:;Exif..MM.*|

But Exif also requires it's marker to be first right after the SOI.
So I now think Michael is right and exiv2 should be fixed instead.

> 
> If there are no other reasons, then IMHO the proposed patch would be
> okay, and I suggest to use it for FLTK 1.1 and 1.3.
> 
> And, BTW, it works, and I can load the example JPEG file ;-)
> 
> 
> Link: http://www.fltk.org/str.php?L2193
> Version: 1.1.9
> Fix Version: Will Not Fix

_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to