Page 1 of 2

zlib

PostPosted: Nov 26, 2002 @ 6:01am
by v0101

PostPosted: Nov 26, 2002 @ 4:46pm
by angedelamort

PostPosted: Nov 27, 2002 @ 12:52am
by v0101

PostPosted: Nov 27, 2002 @ 8:31am
by Malmer

PostPosted: Nov 27, 2002 @ 9:04am
by v0101

PostPosted: Nov 27, 2002 @ 4:32pm
by cryo

PostPosted: Nov 27, 2002 @ 4:36pm
by Dan East
Yep.

Dan East

PostPosted: Nov 27, 2002 @ 4:38pm
by cryo
Thanks Dan,

i have tried that, but it's not working, i always get a Z_DATA_ERROR.

do you have a code sample?

cryo

PostPosted: Nov 27, 2002 @ 6:09pm
by Dan East
Sample to do what, compress or decompress? I just open the file with gzopen and then gzwrite or gzread (and of course stick a .gz on the end if I'm creating).

Dan East

PostPosted: Nov 27, 2002 @ 6:35pm
by cryo
i was trying to store compressed (i.e. gzipped) files as resources, get a pointer to them at run time and decompress using zlib, but i get different errors.

I'm using the inflateInit2, inflate and inflateEnd functions as described in the examples. Also, i am giving inflateInit2 a -15 as second parameter to skip the .gz headers and go straight to the deflated data.

The problem is, none of this works. Has anyone done something like this before?

thanks

cryo

PostPosted: Nov 28, 2002 @ 12:06am
by Malmer

PostPosted: Nov 28, 2002 @ 3:14pm
by v0101

PostPosted: Nov 28, 2002 @ 3:47pm
by cryo
i know it works that way, it's just that the fact that it seems to be impossible to do proper in-memory decompression of a gzipped file with zlib, even if it says it can do so, triggered the sportsman in me.

Anyway, i don't have time to play around with that, so i'll go with writing my own compress prog. as you suggested.

Thanks!

cryo

PostPosted: Nov 28, 2002 @ 5:35pm
by v0101
Yea that really drove me crazy too! I read many other posts about people trying to decompress gzipped files in memory with zlib on Google Groups and no one seemed to have a solution which is why I originally posted. It seems that zlib can't do this...

PostPosted: Dec 7, 2002 @ 10:24am
by brendan