Re: CALL for DISCUSSION: eXIf 20170115

John Bowler <[email protected]>
Newsgroups gmane.comp.graphics.png.general
Message-ID <CAP7U398Wp6nZQkSL5sUV5qF2yGsEmU74ytHgP7S6K2jeUfuXSA@mail.gmail.com>
On Sat, Jan 28, 2017 at 4:51 AM, Glenn Randers-Pehrson
<[email protected]> wrote:
> Back to the drawing board for zxIf.  It needs an "uncompressed length" byte
> at the beginning.

Well, it's off topic, but that's why I was suggesting "cOMp":

<chunk-length>: compressed length + 9
'comp': chunk tag (case matches case of the embedded chunk)
<compression-method>: 1 byte, typically 0 for deflate
<original-length>: 4 bytes
'data': original chunk tag (see below)
<compressed-chunk-data>
<crc32>

Regardless of debates about where the compression byte goes it is
possible to write a simple, streaming, filter for this which simply
copies a PNG from input to output except for replacing every cOMp
chunk, as above, with:

<original-length>: 4 bytes
'data': original chunk tag (see below)
<original-chunk-data>
<generated-crc32>

There is no non-trivial buffering requirement.  Neither is there a
buffering requirement to handle cOMp transparently above a library
like libpng; the read callback identifies 'cOMp' and returns the
original header to libpng then when asked for the data it runs a zlib
inflate engine; libpng actually provides the output buffer!

John Bowler

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.