[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mysterious gzipped images

From: Lars Magne Ingebrigtsen
Subject: Re: Mysterious gzipped images
Date: Mon, 12 Aug 2013 18:27:28 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> But having both "zlib" and "gzipped" in the name is redundant, I
> think.  How about zlib-decompress-region?

zlib supports both decompressing gzip-format data and the older format
which is just called "zlib".  It's a bit confusing.

So if we choose to offer decompressing the older format in the future,
then it would be called `zlib-decompress-zlibbed-region'.  Or
something.  >"?

And as Stefan said, there's possibly a "headerless gzip" format used for
streaming and pdfs, which would (possibly) need a different calling

I'm not sure how much code would be shared between these functions, but
if the main loop is identical, then it would make sense to rename this
function to `zlib-decompress-region' and have the format be a third
parameter (`gzip', `zlib', `gzip-without-a-header')...


windowBits can also be greater than 15 for optional gzip decoding. Add
32 to windowBits to enable zlib and gzip decoding with automatic header
detection, or add 16 to decode only the gzip format (the zlib format
will return a Z_DATA_ERROR). If a gzip stream is being decoded,
strm->adler is a crc32 instead of an adler32.

Oh, we can actually get automatic detection of the zlib and gzip format
by using a different magical constant.  If we did that, then it would
totally make sense to rename the function.

(domestic pets only, the antidote for overdose, milk.)
  No Gnus T-Shirt for sale: http://ingebrigtsen.no/no.php
  and http://lars.ingebrigtsen.no/2013/08/twenty-years-of-september.html

reply via email to

[Prev in Thread] Current Thread [Next in Thread]