Extend compress function

Alejandro Tejada capellan2000 at gmail.com
Thu Oct 16 13:53:47 EDT 2014


Hi All,

On December 13 of 2012,
Jan Schenkel - http://www.quartam.com
wrote on Livecode Quality Center:

------------------------------------------------------------------------
Currently the compress/decompress function pair only supports 'gzip'
compression as defined in <http://tools.ietf.org/html/rfc1952>

The open source zlib library also offers support for:
- ZLIB compression as defined in <http://tools.ietf.org/html/rfc1950>
- DEFLATE compression as defined in <http://tools.ietf.org/html/rfc1951>

As these are widely used compression techniques (e.g. the PNG file
format uses DEFLATE compression) I propose adding an optional second
parameter to the compress/decompress function pair:
- compress(<data> [, <compression>])
- decompress(<data> [, <compression>])
Where <compression> is one of "GZIP"|"DEFLATE"|"ZLIB" with "GZIP" as
default for backward compatibility.

This will enhance communication with HTTP server technologies, and
enable developers to parse file formats which apply these compression
techniques (PNG files, PDF files), without having to resort to
platform-specific externals.
------------------------------------------------------------------------

Today, I just added this comment to Jan's request:

These additions to Livecode compress would be really useful and
will open many possibilities to create new applications and
utilities.

Could you include BZIP2 among the options proposed by Jan Schenkel?

In this way, <compression> is one of "GZIP"|"DEFLATE"|"ZLIB"|"BZIP2"
with "GZIP" as default for backward compatibility.

http://www.bzip.org/

If you find these additions useful for your current or future
development work in this platform, please add your comments to this
request:

http://quality.runrev.com/show_bug.cgi?id=10594

Thanks in advance!

Al




More information about the use-livecode mailing list