Questions tagged [compression]

The name given to the process of encoding data such that it uses lesser number of bits as compared to the original representation.

There are a number of techniques to compress information, with most algorithms working to compress image, speech, music or video. Encoding the same information in lesser bits results in saving some crucial resource such as transmission bandwidth or hard-disk space. Compression algorithms also take advantage of human perception to further reduce the size of information. By encoding the same piece of information with fewer bits in places that the human brain is not accustomed to perceiving as well as other parts, substantial gains in compression ratios can be achieved.

9175 questions
4
votes
1 answer

How to compress images in CodeIgniter, yet do not change their dimensions?

I have a site where users can upload images. I process these images directly and resize them into 5 additional formats using the CodeIgniter Image Manipulation class. I do this quite efficiently as follow: I always resize from the previous format,…
Fer
  • 4,116
  • 16
  • 59
  • 102
4
votes
1 answer

ZDecompressStream() causes memory leak

I've been using ZLib functions to compress/uncompress streams in memory. In case when I try to uncompress invalid stream, it leaks memory. The following code would leak memory: uses Winapi.Windows, System.Classes, System.ZLib; function…
rsrx
  • 1,433
  • 1
  • 13
  • 25
4
votes
1 answer

Boost Iostreams zlib_error with Custom Source

I am trying to use a zlib_decompressor to decompress data through an istreambuf_iterator. I couldn't find an in built way to use an input iterator as input to a stream (please point out a way if one exists already) so I wrote this source: template…
Ell
  • 4,238
  • 6
  • 34
  • 60
4
votes
5 answers

Compressing CSS and JS without mod_gzip and mod_deflate

I would like to compress the CSS and JS files on my server to minimise load times, problem. My hosting is with Streamline.net (big mistake, never go there) who will not activate mod_gzip and mod_deflate due to security issues. Does anyone have…
DanC
  • 1,297
  • 4
  • 24
  • 42
4
votes
3 answers

PHP iMagick image compression

I'm fairly new to iMagick and have only found very limited documentation on the PHP library. I'm happily resizing images and writing them back to the hard drive, but I'm failing completely to compress the images using JPG for instance. This is the…
Rob Forrest
  • 7,329
  • 7
  • 52
  • 69
4
votes
4 answers

compressing a huge set of similar strings

I am looking at a python script that maintains a huge set of strings. The strings are actually full paths to log file names from a regression test runs. The number of files is so large that the script starts hitting the virtual address space…
glagolig
  • 1,100
  • 1
  • 12
  • 28
4
votes
2 answers

TAR file format issue

It is unclear to me, what is a correct .tar file format, as I am experiencing proper functionality with three scenarios (see below). Based on .tar specification I have been working with, the magic field (ustar) is null-terminated character string…
Ωmega
  • 42,614
  • 34
  • 134
  • 203
4
votes
1 answer

MemoryStream VS FileStream which one is better to use in Webservice for GZipStream decompress?

I have a asp.net webservice. some functionality of this webservice is to decompress clients request first. for this i have wrote 2 methods one uses MemoryStream and other uses FileStream. When using MemoryStream sometiomes it get…
Rezoan
  • 1,745
  • 22
  • 51
4
votes
1 answer

Service Stack enable compression globally

WE used the following post to enable compression on our Service Stack API. Enable gzip/deflate compression. We have the following code in my AppHost file: public override IServiceRunner CreateServiceRunner(ActionContext…
RuSs
  • 1,725
  • 1
  • 29
  • 47
4
votes
3 answers

efficient way to compress a numpy array (python)

I am looking for an efficient way to compress a numpy array. I have an array like: dtype=[(name, (np.str_,8), (job, (np.str_,8), (income, np.uint32)] (my favourite example). if I'm doing something like this: my_array.compress(my_array['income'] >…
Louis
  • 1,392
  • 2
  • 11
  • 16
4
votes
1 answer

How do you compress a directory in Squeak Smalltalk?

How do you compress a directory in Squeak Smalltalk? I found the compressFile method in StandardFileStream but I can't figure out how to compress multiple files or a directory. I experimented with the System-Compression classes but haven't had much…
4
votes
4 answers

C# - XML - Compression

I have a situation where I am generating a XML file to be submitted to a webservice, sometimes due to the amount of data it exceeds 30mb or 50mb. I need to compress the file, using c#, .net framework 4.0, rather one of the nodes which has most of…
user2664502
  • 85
  • 2
  • 2
  • 5
4
votes
2 answers

Are there any free compression utilities that zip in real time like Xceed Real-Time Zip?

What I need to do is compress 64KB chunks of a file as they're coming in from an external service and then stream that chunk of compressed data to the browser all in real time. Xceed Real-Time is pretty awesome in how you can set the header of the…
TheDude
  • 1,421
  • 4
  • 29
  • 54
4
votes
2 answers

compressing a string in C# and uncompressing in python

I am trying to compress a large string on a client program in C# (.net 4) and send it to a server (django, python 2.7) using a PUT request. Ideally I want to use the standard library at both ends, so I am trying to use gzip. My C# code is: public…
eggbert
  • 3,105
  • 5
  • 30
  • 39
4
votes
3 answers

How to compress a file (gzip) using boost libraries in C++

Im trying to compress a file using boost library (gzip). Its a simple task: lets suppose i have the file data.xml and I need to compress it to data.xml.gz. I can even use the default compression values, doesn't matter. I tryed to look up in google…
Vasco Baptista
  • 653
  • 2
  • 8
  • 15
1 2 3
99
100