Skip to content

Can't produce zip with STORE method (uncompressed data) #286

@darekrusin

Description

@darekrusin

When I pack a zip using WinRar for example and select the "store" method for an uncompressed archive, the algorithm used is reported as "store" and the file size is only a few hundred bytes larger than the compressed data.

But using rubyzip, even when I select Zlib::NO_COMPRESSION something weird happens:

  • the file indeed has no compression (I can see parts of the original data readable inside), but the resulting zip size is larger, it gains about 8 KB on a 60 MB file
  • the file being zipped is not stored as a raw blog inside the zip but it's chunked with some kind of checksums mixed in
  • the algorithm reported is "deflate" instead of "store"

This is a problem for situation where a truly uncompressed zip is needed, with a raw binary version of the original file inside.

Am I doing something wrong? Is there a way to force the gem to work this way, or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions