K
KJ
I am using the System.Compression.GZipStream class, and I noticed that
in certain cases, the resultant compressed file is actually larger than
the original. This is almost a constant when compressing
already-compressed formats such as jpeg.
Another less-consistent example of this behavior is found in the case
of compressing TIFFs, wherein some files end up greatly compressed (the
larger ones up to 93% compression ratio) and others end up larger than
the originals.
I have 2 questions:
a) Is there some way to know whether a file will actually compress
*before* perfoming the compression routine (aside from using its file
extension)?
b) Is there a way to gzip a file without doing compression when I know
that performing the compression routine will end up in a larger file?
It seems WinZip is able to do this by adding files to archives without
compressing them.
Thanks in advance.
-KJ
in certain cases, the resultant compressed file is actually larger than
the original. This is almost a constant when compressing
already-compressed formats such as jpeg.
Another less-consistent example of this behavior is found in the case
of compressing TIFFs, wherein some files end up greatly compressed (the
larger ones up to 93% compression ratio) and others end up larger than
the originals.
I have 2 questions:
a) Is there some way to know whether a file will actually compress
*before* perfoming the compression routine (aside from using its file
extension)?
b) Is there a way to gzip a file without doing compression when I know
that performing the compression routine will end up in a larger file?
It seems WinZip is able to do this by adding files to archives without
compressing them.
Thanks in advance.
-KJ