Re: CFD: eXIf 2017-06-09a

Glenn Randers-Pehrson <[email protected]> Fri, 9 Jun 2017 08:44:28 -0400
Newsgroups gmane.comp.graphics.png.general
Message-ID <CA+PdXct0E4OiBvSVAFUaj34-eLtuFsqdYv2f-ohoLwnU1ETj-g@mail.gmail.com>
On Fri, Jun 9, 2017 at 8:40 AM, Glenn Randers-Pehrson <[email protected]> wrote:
> On Fri, Jun 9, 2017 at 8:27 AM, Phil Harvey <phil-CIeU6mJ2MbMd166Dz3SrqbDks+cytr/[email protected]> wrote:
>> This version mentions 2^16-2 as the maximum size that will fit in
>> a JPEG APP1 segment.  The exact number is 2^16-9 as I mentioned
>> previously.
>
> This version says (correctly, I believe):
>
> While the PNG specification allows the chunk size to be as large as
> 2^31-1 bytes, decoders should be aware that, if the Exif profile is
> written to a JPEG datastream, the total length of the Exif data (the
> sum of the lengths of the Exif attributes IFD, the GPS IFD, the
> thumbnail IFD, and the TIFF header) may need to be adjusted to not
> exceed 2^16-2 bytes, so it can fit into a JPEG APP1 marker.
>
> That works out to be 2^16-9 when you take 2^16-1 and subtract 2-byte
> length and 6-byte "Exif\0\0".

Ah, OK.  I thought the sum included the Exif\0\0 but that seems
to have been lost somewhere along the line.  I'll put it back in.

Glenn

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot