This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: ZLIB: using gzip decompression in combination with libpng
- From: Andrew Lunn <andrew at lunn dot ch>
- To: stephane dot deltour at i4surf dot net
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Mon, 28 Nov 2005 19:31:11 +0100
- Subject: Re: [ECOS] ZLIB: using gzip decompression in combination with libpng
- References: <20051128154317.7360.qmail@mail2.i4gate.net>
On Mon, Nov 28, 2005 at 04:43:17PM +0100, stephane.deltour@i4surf.net wrote:
>
> Libpng uses inflateInit/deflateInit. So it will rely on the default
> windowBits parameter. Libpng doesn't seem to work when MAX_WBITS is
> defined to 15+16. To decompress gzip data, I use inflateInit2 with
> the windowBits set to 15+16. I don't use gzopen because I don't
> have/use a file system. The data I need to decompress is located in
> memory.
You probably want to take a look at gzopen and see how it works. You
can then see how to stip the gzip header off your data and call
inflateInit2() etc.
> It seems indeed that the CYGSEM_COMPRESS_ZLIB_DEFLATE_MAKES_GZIP is
> not ideal.
No. I think we need to add an eCos function gzuncompress() which
correctly handles the gzip header and it would be nice to check the
default of CYGSEM_COMPRESS_ZLIB_DEFLATE_MAKES_GZIP to zero, but i
suspect that will break too many systems.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss