R
R
Roman Mirilaczvili2016-08-05 13:58:12
linux
Roman Mirilaczvili, 2016-08-05 13:58:12

What software can repack a ZIP file on the fly using a different compression ratio?

There is a zip file. It is necessary to repack on the fly into a new archive without first unpacking the archive (for example, through a pipe), using a stronger / weaker compression ratio.
Is it possible? If so, how?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Roman Mirilaczvili, 2016-08-05
@2ord

The AdvanceCOMP advzip utility seems to do what I need.

-z, --recompress ARCHIVES...
Recompress the specified archives. If the -1, -2, -3, -4 options are specified, it's used the smallest file choice from: the previous compressed data, the new compression and the uncompressed format. If the -0 option is specified the archive is always rewritten without any compression.
...
-1, --shrink-fast
Set the compression level to "fast" using the zlib compressor.
-2, --shrink-normal
Set the compression level to "normal" using the 7z compressor. This is the default level of compression.
-3, --shrink-extra
Set the compression level to "extra" using the 7z compressor. You can define the compressor iterations with the -i, --iter option.
-4, --shrink-insane
Set the compression level to "insane" using the zopfli compressor. You can define the compressor iterations with the -i, --iter option.

D
Dmitry Shitskov, 2016-08-05
@Zarom

Yes, it's possible. For example, repack with 9 compression ratio:
unzip -p ./filename.zip | zip -9 ./filename2.zip -

D
Danil Biryukov-Romanov, 2016-08-05
@urtow

The same 7z can unpack to stdout and read from Stdin.

-si[{name}]: read data from stdin
-so: write data to stdout

That is, it will look like this 7z -so archive | 7z -si archive

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question