Thank you for this information, Alejandro. Here's the rub: I'm trying to parse existing PNG files which I didn't create, so I don't know beforehand what the uncompressed data size would be. On the other hand, I should be able to figure out what the original size is: I'm trying to inflate the pixel data, and I know the width and height, as well as the bits per component.
Another potential pitfall is that DEFLATE may employ Huffman codes, which isn't part of the GZIP file format. Anyway, I now have a new way to tackelt his problem, so thanks again! Once I have it working, it will be part of the open source Quartam PDF Library. Cheers, Jan Schenkel. ===== Quartam Reports & PDF Library for LiveCode www.quartam.com ===== "As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld) ----- Original Message ----- From: Alejandro Tejada <capellan2...@gmail.com> To: use-revolut...@lists.runrev.com Cc: Sent: Thursday, December 13, 2012 11:00 PM Subject: Re: ZLib DEFLATE Hi Jan, I forgot to wrote: Decompress function (Deflate) in Livecode does not care at all about the gzip's crc32, but will truncate or append binary data to fit the decompressed data length as stated in the last four bytes of the gzip binary string... This means that you could create an invalid gzip string by appending a header, an invalid crc32 string of 4 bytes, but the last four bytes must have the exact length of the decompressed data or this data will be truncated or inflated with a lot of garbage at the end, just to "fill". If you are creating yourself this deflated binary string, then you could know the decompressed data length in advance. Alejandro -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/ZLib-DEFLATE-tp4658027p4658096.html Sent from the Revolution - User mailing list archive at Nabble.com. _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode