473,395 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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???
Jun 1 '09 #1
5 1091
NeoPa
32,556 Expert Mod 16PB
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!
Jun 1 '09 #2
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.
Jun 2 '09 #3
NeoPa
32,556 Expert Mod 16PB
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.
Jun 2 '09 #4
Ciary
247 Expert 100+
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
Jun 2 '09 #5
AmberJain
884 Expert 512MB
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:
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 Images
File Type: jpg size.jpg (17.0 KB, 106 views)
Jun 5 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Maurice Mertens | last post by:
Hello, I'm having troubles with saving a tiff-file with a certain compression and colordepth. This is the code I use: ----------------------------------------------------------------------...
2
by: Frederic Hoornaert | last post by:
Hi, We're starting a new project with WebServices and I have a few qeustions about the compression mechanisms we can use. We have already tested with Http Compression and WSE Compression, but...
8
by: Anurag | last post by:
Hi, I am told that Oracle has this "data compression" feature that allows you to store online data ina compressed format. This is different from archived data - you compress only that data which...
2
by: deko | last post by:
Is it best practice to set Unicode Compression to "No" for memo fields in a table? What about text fields? According to the VB help entry: "Data in a Memo field is not compressed unless it...
4
by: Anders K. Jacobsen [DK] | last post by:
Hi Does anyone have experience using gZip compression on the IIS server with a ASP.NET application. How much can a page be compressed. As i see it it must have a huge impact on the total size....
16
by: Claudio Grondi | last post by:
What started as a simple test if it is better to load uncompressed data directly from the harddisk or load compressed data and uncompress it (Windows XP SP 2, Pentium4 3.0 GHz system with 3 GByte...
2
by: Eyal Lotem | last post by:
Hey. I have a problem in some network code. I want to send my packets compressed, but I don't want to compress each packet separately (via .encode('zlib') or such) but rather I'd like to...
3
by: Benny Ng | last post by:
Dear All, Now I met some performance problems in my application. Because according to our business. The size of some web forms are larger than 1xxx MB. So it takes a long time for user opening a...
5
by: jeremyje | last post by:
I'm writing some code that will convert a regular string to a byte for compression and then beable to convert that compressed string back into original form. Conceptually I have.... For...
4
by: =?Utf-8?B?Sm9uIEphY29icw==?= | last post by:
The compression part of this code works fine for me, but the decompression part of this code does not. The output file from that is the same as the compressed file. What is wrong with my code?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.