Compression Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SalimZaabi
    New Member
    • May 2009
    • 14

    Compression Problem

    I'm trying to compress files, but I noticed that the files lenght has been increased ????

    I tried different ways, but the result is the same.
    Anyone can explain why???
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32656

    #2
    I've moved this across for you as you had posted it in Milestones for some reason (a simple mistake I'm sure).

    What file are you trying to compress?

    Files that are already in compressed format typically grow slightly when an attempt is made to re-compress them.

    Hope this helps and Welcome to Bytes!

    Comment

    • SalimZaabi
      New Member
      • May 2009
      • 14

      #3
      Hi NeoPa,

      thanks for replying.. I have tried several type of files, .txt , .jpg , I ended up with the same result, the file size increases and the file has not been compressed.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32656

        #4
        I can only assume that you're not actually compressing them. Possibly you are doing something wrong, but from here there's no way I know of to say what that may be.

        Comment

        • Ciary
          Recognized Expert New Member
          • Apr 2009
          • 247

          #5
          not every file can be compressed as NeoPa stated. but it happens to other files too (not only compressed files). sometimes a file becomes larger because of failed attempts to compress. if you want to be sure: take a file of ten pages long and copy/paste it 10 times in a txt-file. if the file will still be larger than the original, then there is something wrong

          Comment

          • AmberJain
            Recognized Expert Contributor
            • Jan 2008
            • 922

            #6
            Hello,

            There are two possibilities:

            1. The file that you are compressing is very small in size
            If a file is very small in size (typically a few bytes), then compressing them to all major formats (7z, zip, bzip2 etc) increases their size. The reason for this is that the compressed file has some specific format (like file header, compression info etc.). Even if original file contains only a few bytes of data, compressing it converts into another file type which adds format specific info to the file that increases the size of file.
            IMO, compressing files of few bytes in size will not serve any purpose. So you should just ignore if this is the case. Or else, try as Ciary suggested:
            Originally posted by Ciary
            if you want to be sure: take a file of ten pages long and copy/paste it 10 times in a txt-file. if the file will still be larger than the original, then there is something wrong

            2. Maybe you are confused with 'actual file size' and 'size of file on disk'
            The actual size of file and size of file on the disk are two different sizes and may or may not be equal. If you right click a file on Windows XP, then you see these two sizes. I think that if this is the case, then you are probably comparing size of file (in case of original file) and size of file on disk in case of compressed file. Usually, size of file on disk is greater than actual file size.

            Hope this helps....
            AmbrNewlearner
            Attached Files

            Comment

            Working...