Good zip library ?

A place for Ogre users to discuss non-Ogre subjects with friends from the community.
Post Reply
User avatar
madmarx
OGRE Expert User
OGRE Expert User
Posts: 1671
Joined: Mon Jan 21, 2008 10:26 pm
x 51

Good zip library ?

Post by madmarx »

Hello everyone,

Does someone know a good zip library allowing :
> compression into memory
> compression into a file
> compression of a directory tree (or a bunch of files) into 1 file
> decompression
> decompression into memory of a chosen file.
> decompression with password/key (decryption)
> working on windows
> without memory issue!
?

I have also 2 other needs that are less important :
> compression with encryption (using key/password)).
> multiplatform linux, mac ?

Right now, it seems the zlib is near what I am looking for, but I can't find informations on password / encryption of files.
If you have knowledge on these zip question, that may enlighten me, don't hesitate to share it :wink: .

If you know one library, please let me know, I'll patch Ogre::source with the corresponding Ogre::Archive, promise!

EDIT : after a little thinking it seems encrypting is ok, since each file is encrypted separately, and not as a whole. I just need to encrypt myself each files!
Tutorials + Ogre searchable API + more for Ogre1.7 : http://sourceforge.net/projects/so3dtools/
Corresponding thread : http://www.ogre3d.org/forums/viewtopic. ... 93&start=0
User avatar
stoneCold
OGRE Expert User
OGRE Expert User
Posts: 867
Joined: Fri Oct 01, 2004 9:13 pm
Location: Carinthia, Austria
x 1

Re: Good zip library ?

Post by stoneCold »

The best compression you might get by using the compression algorithms that 7zip offers. There seems to be a project over at google code that exposes the 7zip API.
The LZMA algorithm delivers quite good results when it comes to compression/speed, so this one might fit best for your needs.

[edit]: the LZMA part of 7zip seems to be available under the public domain as well, so this might be worth checking out too.
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Good zip library ?

Post by jacmoe »

Ratcliff has a compression/decompression performance test going:
http://www.codesuppository.blogspot.com/

I am very interested in FastLZ myself. (http://www.fastlz.org/)
But, you can't have both speed and zero overhead and good compression at the same time.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 116

Re: Good zip library ?

Post by mkultra333 »

I've notices 7-zip files (.7z) gives slightly better than zip compression when archiving a single project, but when putting a bunch of almost identical projects into a single .7z file the compression is awesome, much better than zip. It seems to recognize when two folders of stuff are virtually identical, where normal zip compression doesn't.

Decompression can be slow sometimes though when you've compressed multiple similar folders. About the same as zip for a single folder though.
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Re: Good zip library ?

Post by syedhs »

Yes agree that 7zip provides superior compression - nowadays, I use this to compress my file to send over email for an example. And the 7zip library is available for creator itself, at www.7-zip.org. The license is "public domain" - last time it was GPL, but commercial uses can have different license.
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 116

Re: Good zip library ?

Post by mkultra333 »

Probably worth pointing out that the 7zip library covers zip compression as well.
Supported formats:

* Packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR
* Unpacking only: ARJ, CAB, CHM, CPIO, DEB, DMG, HFS, ISO, LZH, LZMA, MSI, NSIS, RAR, RPM, UDF, WIM, XAR and Z.
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
User avatar
madmarx
OGRE Expert User
OGRE Expert User
Posts: 1671
Joined: Mon Jan 21, 2008 10:26 pm
x 51

Re: Good zip library ?

Post by madmarx »

I had already a glimpse at the lzma before, and the code seems to me like a real mess.
In the end I had to make 'search' in the directory structure to find the required cpp! Then, the doc is close to nothing.
For that reason, I was looking for some other package.
Fzip proposed by jacmoe is much more easy (2 functions only!). Unfortunately, it does not handle multiples files (and unzipping only one in a zip).
I am currently working on an elegant solution with database+ multiple fziped files + a listener to encrypt / decrypt data.
Tutorials + Ogre searchable API + more for Ogre1.7 : http://sourceforge.net/projects/so3dtools/
Corresponding thread : http://www.ogre3d.org/forums/viewtopic. ... 93&start=0
Post Reply