Results 1 to 4 of 4

Thread: Zip makes files bigger?

  1. #1
    Join Date
    Dec 2008
    Beans
    Hidden!

    Question Zip makes files bigger?

    A strange thing happens when I try to zip a certain directory... The right click - compress fails with an error, and the command line "zip -r output.zip foldername" successfully makes a zip, but in properties box, it appears to be about 16mb bigger than the original zip?!

  2. #2
    Join Date
    Oct 2006
    Location
    New York
    Beans
    1,118
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: Zip makes files bigger?

    There are certain cases in which this can happen. You can try some other compression options, tar+gzip being the sort of linux standard. tar+xz being a newer version that's gaining a lot of popularity. I'm personally fond of tar+lrzip, but that's sort of uncommon. It's likely that either
    1) zip does not handle a large number of small files well, and that's what you have in the directory, or
    2) the files are nearly incompressible, in which case you wouldn't expect to have much better luck using another method.
    3) I suppose it's also possible zip is dereferencing symbolic links, replacing one copy of a file with two copies.
    4) Any of the multidunious things I haven't thought of.
    xubuntu minimal, extensive experience, lshw: http://goo.gl/qCCtn
    blog: http://goo.gl/yLg78
    Linux viruses: http://goo.gl/6OCKA

  3. #3
    Join Date
    Apr 2005
    Location
    Finland/UK
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Zip makes files bigger?

    If you are trying to compress files that are already compressed data (most image files, MP3's, video files etc.) then it's quite normal that the resulting archive is larger than originals. The lossless compression method can't compress the data any smaller than it already is, and the archive contains some metadata of it's own so you end with larger file than the originals.

  4. #4
    Join Date
    Mar 2010
    Location
    ρθΦ=000
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Zip makes files bigger?

    Quote Originally Posted by mcduck View Post
    If you are trying to compress files that are already compressed data (most image files, MP3's, video files etc.) then it's quite normal that the resulting archive is larger than originals. The lossless compression method can't compress the data any smaller than it already is, and the archive contains some metadata of it's own so you end with larger file than the originals.
    Aye - came here to say this.

    The only reason (IMO) to zip (among other things) compressed images (like .jpg) or music (like .mp3) is so that all the files are contained in one convenient-to-download or archive .zip file. In this case, you'll want to select a no compression option and simply store the files in the archive rather than attempting to re-compress them.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •