login about faq

I am using your trail for Mac OS X C++ library, "libchilkat.dylib", to test zip with password protected. Its not working for image files(jpg, png) but working for other files like mp3, etc .. When I try to unzip using Mac's default Archive Utility then file error message is shown. Please check the attached snapshot.

do I need to do anything special to zip (with password enabled) image files ?

Environment: - Mac OS X Lion (10.7) - Xcode 4.3.3

asked Aug 22 '12 at 10:34

chilkat's gravatar image

chilkat ♦♦

The password-protected .zip's created w/ Chilkat open with other tools such as WinZip, or StuffIt Expander, but not with the Mac's default "Archive Utility".

Maybe there is an issue in Mac's "Archive Utility" itself.


answered Aug 22 '12 at 10:36

chilkat's gravatar image

chilkat ♦♦

It sounds like a defect in the Mac's default "Archive Utility". It probably cannot handle password-protected entries within the .zip that have no compression. Many files, such as JPG, are already compressed and trying to compress further is computationally very expensive, and results in very little or no additional size reduction. Therefore, Chilkat Zip automatically uses a compression level = 0 (no compression) for these types of files. See the AddNoCompressExtension method in the Zip online reference documentation.

public void AddNoCompressExtension(string fileExtension);

Attempting to compress already-compressed data is usually a waste of CPU cycles with little or no benefit. In fact, it is possible that attempting to compress already-compressed data results in a slightly increased size. The Zip file format allows for files to be "stored" rather than compressed. This allows the file data to be streamed directly into a .zip without compression. An instance of the Zip object has an internal list of "no compress" extensions. A filename with a "no compress" extension is "stored" rather than compressed. Additional "no compress" extensions may be added by calling this method (once per file extension). You should pass the file extension, such as ".xyz" in fileExtension.

"no compress" extensions may be removed by calling RemoveNoCompressExtension.

The default "no compress" extensions are: .zip, .gif, .jpg, .gz, .rar, .jar, .tgz, .bz2, .z, .rpm, .msi, .png

You might try calling RemoveNoCompressExtension for each of the default "no compress" extensions.


answered Aug 22 '12 at 10:38

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Aug 22 '12 at 10:34

Seen: 2,363 times

Last updated: Aug 22 '12 at 10:42

powered by OSQA