Important information: this site is currently scheduled to go offline indefinitely by end of the year.

ZLib library - Compression + Decompression

Coders and would-be coders alike, this is the place to talk about programming.
Post Reply
grimdoomer
advanced
Posts: 70
Joined: Fri Mar 21, 2008 8:11 pm
Location: New York
Been thanked: 1 time

ZLib library - Compression + Decompression

Post by grimdoomer »

I need a zlib library that I can use in my C# program. I've tried zlib.net, but it has some wierd compression error, were my output stream can end up with a length of 2? So I need one that works 100%.
Rheini
Moderator
Posts: 652
Joined: Wed Oct 18, 2006 9:48 pm
Location: Germany
Has thanked: 19 times
Been thanked: 46 times
Contact:

Re: ZLib library - Compression + Decompression

Post by Rheini »

http://datacompression.info/Zlib.shtml
maybe there's something for you.
grimdoomer
advanced
Posts: 70
Joined: Fri Mar 21, 2008 8:11 pm
Location: New York
Been thanked: 1 time

Re: ZLib library - Compression + Decompression

Post by grimdoomer »

Thanks, that led me to a xceed library that worked perfect!
eycaramba
veteran
Posts: 86
Joined: Wed Sep 02, 2009 1:52 pm
Has thanked: 30 times
Been thanked: 2 times

Re: ZLib library - Compression + Decompression

Post by eycaramba »

Is there a finished tool for it?
I cannot code but would really need a program to compress files with zlib. For some strange reason I cannot find any :eek:

EDIT: ZOMG 2k8 topic x.x I'm sorry :D But please help me anyway ^^"
merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 121 times

Re: ZLib library - Compression + Decompression

Post by merlinsvk »

eycaramba wrote:... a program to compress files with zlib.
Maybe Rheini's zlibc is what you are looking for viewtopic.php?p=20205#p20205
eycaramba
veteran
Posts: 86
Joined: Wed Sep 02, 2009 1:52 pm
Has thanked: 30 times
Been thanked: 2 times

Re: ZLib library - Compression + Decompression

Post by eycaramba »

Yeah, this is exactly what I am looking for. Thank you, this is really nice :)
The thing is I have to deal with a filesize limit. If I re-compress the original unmodified file, the filesize exactly matches.
If I compress the modified file, the filesize is way bigger oO
Is this due to how zlib's algorhythm works? The Size on disk is the same, however I need to put back that file in a binary dump hex file and so yah...

Is there no other possibility than finding and modifying the file table (if there is any)?
merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 121 times

Re: ZLib library - Compression + Decompression

Post by merlinsvk »

I know nothing about compressing/programming etc., but did you try all 9 compression levels with zlibc?
eycaramba
veteran
Posts: 86
Joined: Wed Sep 02, 2009 1:52 pm
Has thanked: 30 times
Been thanked: 2 times

Re: ZLib library - Compression + Decompression

Post by eycaramba »

Yep. Mostly the same result, but never small like the original...
merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 121 times

Re: ZLib library - Compression + Decompression

Post by merlinsvk »

Hmm I have no idea. Maybe Rheini or some "veteran" user could help you.
Rheini
Moderator
Posts: 652
Joined: Wed Oct 18, 2006 9:48 pm
Location: Germany
Has thanked: 19 times
Been thanked: 46 times
Contact:

Re: ZLib library - Compression + Decompression

Post by Rheini »

eycaramba wrote:If I compress the modified file, the filesize is way bigger oO
deflate basically works by exploiting repetitions in the code. It does so by using a history window that keeps track of the last x read bytes (e.g. 1KB). So if you modify the contents you get a different compression result.
brienj
VIP member
VIP member
Posts: 288
Joined: Mon May 02, 2005 1:48 pm
Location: Louisville, KY
Has thanked: 10 times
Been thanked: 70 times
Contact:

Re: ZLib library - Compression + Decompression

Post by brienj »

Here's a few things to help with zlib compression/decompression. None of this is my creation, but the APL Zlib Tool can not be found anywhere on the internet anymore, so I uploaded it to my website for those that want to try it. I can not remember who created the actual APL Zlib Tool, or I could give the original author credit for it. I also have some source code that this tool was based on, and the source code according to the readme file is made by Mark Nelson, Tiny Software, [email protected], http://web2.airmail.net/markn, but I can no longer find this person on the internet, nor can I find a working website for him or his company.

Well anyway, here is the source code for the library:
http://brienj.home.insightbb.com/zlibtool.zip

And here is the installer for the APL Zlib Tool:
http://brienj.home.insightbb.com/aplzltsetup.rar

The APL Zlib Tool has the option to change the compression level from 0 to 9 and works with all zlib compression I've tried it on. I was once going to make a program to do it, but why re-invent the wheel, as they say. :lol:

Hope this is useful to some people. :)
Post Reply