Results 1 to 4 of 4

Thread: de-zlibber ?

  1. #1
    Member
    Join Date
    Sep 2010
    Location
    US
    Posts
    126
    Thanks
    4
    Thanked 69 Times in 29 Posts

    de-zlibber ?

    Is there any tool out there to un-deflate zlib streams?

    What I mean is take a file with zlib data (a .gz or .png or .swf or .pdf or whatever) and replace it with zlib level 0 ("store") data. The idea is that it's uncompressed but is still valid data that can be loaded by the target application.

    This is different than what tools like precomp do, which try to restore the original zlib stream to be lossless in bytes.

    Obviously there's a robustness problem. Tools like precomp are safe against incorrectly identified deflate streams because they restore the original bytes exactly. A deflate-to-store transform could corrupt data if it made a mistake, so it would need to be more aware of the file format it was working in, not just blindly look for deflate streams.

    The idea is to avoid the re-zlibbing, which is extremely slow at decode time. It's also particularly silly for something like loading a PNG into memory, since as soon as you use that PNG it will just be un-deflated again. Ideally with things like PNGs I would transform them all to zlib level 0 (store) before compressing.
    Last edited by cbloom; 3rd August 2016 at 19:05.

  2. #2
    Member
    Join Date
    May 2008
    Location
    Kuwait
    Posts
    301
    Thanks
    26
    Thanked 22 Times in 15 Posts
    I know this tool but could not manage to work it out.

    http://aluigi.altervista.org/mytoolz.htm#offzip

    I've run it on PDF's and could find (decompress) same number of streams as Precomp. may be Precomp could be your aim but resulted file is not functional (after removing header).
    Last edited by maadjordan; 25th July 2016 at 15:38.

  3. #3
    Administrator Shelwien's Avatar
    Join Date
    May 2008
    Location
    Kharkov, Ukraine
    Posts
    3,134
    Thanks
    179
    Thanked 921 Times in 469 Posts
    Well, I patched reflate's rawdet to do it (conversion to deflate-store).
    It seems to work for .gz and maybe .pdf, but as expected, not for formats which use packed size etc.
    But at least it should be useful for compression gain estimation.

    http://nishi.dreamhosters.com/u/rawconv_v0.rar

    Also, for .png there's this utility - http://entropymine.com/imageworsener/
    It can be used like this:
    imagew.exe -opt deflate:cmprlevel=0 1.png 2.png

  4. The Following User Says Thank You to Shelwien For This Useful Post:

    RamiroCruzo (26th July 2016)

  5. #4
    Member
    Join Date
    May 2008
    Location
    Kuwait
    Posts
    301
    Thanks
    26
    Thanked 22 Times in 15 Posts
    for .png, .mng, .gz, .tgz and .svgz files you can use Advdef from Advcomp package with -z0 option. refer to info at http://www.advancemame.it/doc-advdef

Similar Threads

  1. [LZ] M/T & GPU (de)compression
    By Bulat Ziganshin in forum Data Compression
    Replies: 0
    Last Post: 31st December 2015, 13:09
  2. Memory Usage vs. Memory Requirements for (De)Compression?
    By comp1 in forum The Off-Topic Lounge
    Replies: 7
    Last Post: 1st June 2015, 04:53
  3. Replies: 8
    Last Post: 12th April 2009, 02:39
  4. Can't allocate memory required for (de)compression..help!
    By Duarte in forum Data Compression
    Replies: 19
    Last Post: 18th July 2008, 18:14

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •