Questions tagged [deflate]

deflate is a lossless data compression format, and also refers to implementations that compress to the deflate format. The deflate format was created by Phil Katz of PKWare for the PKZip (.zip) archive format. Public domain software provides deflate and inflate functionality in the gzip utility and the zlib library.

Documentation of the deflate format may be found in RFC-1951

588 questions
22
votes
1 answer

Is it possible to force jQuery to make AJAX calls for URLs with gzip/deflate enabled?

I have a web service that is willing to output gzip/deflated data. I've verified that the service will respond with raw JSON or with gzip'd JSON using wget and curl. I want to consume this web service using the jQuery AJAX call. By default, the…
Lee
  • 905
  • 2
  • 9
  • 19
20
votes
6 answers

Can I POST data with python requests lib with http-gzip or deflate compression?

I use the request-module of python 2.7 to post a bigger chunk of data to a service I can't change. Since the data is mostly text, it is large but would compress quite well. The server would accept gzip- or deflate-encoding, however I do not know how…
AME
  • 2,499
  • 5
  • 29
  • 45
18
votes
2 answers

Is there any performance hit involved in choosing gzip over deflate for http compression?

We recently switched some of our sites from deflate to gzip and noticed a significant increase in cpu load on our servers.
kitsune
  • 11,516
  • 13
  • 57
  • 78
18
votes
2 answers

GZIPOutputStream: Increase compression level

java.util.zip.GZIPOutputStream does not provide a constructor argument or a setter for the compression level of its underlying Deflater. There are ways to work around this issue, as described here, for example: GZIPOutputStream gzip = new…
schnatterer
  • 7,525
  • 7
  • 61
  • 80
14
votes
2 answers

Is there a GZIP merger that merges two GZIP files without decompressing them?

Let's say there's a.gz, and b.gz. $ gzip_merge a.gz b.gz -output c.gz I'd like to have this program. Of course, $ cat a.gz b.gz > c.gz doesn't work. Because the final DEFLATE block of a.gz has BFINAL, and the GZIP header of b.gz. (Refer to RFC1951,…
yogman
  • 4,021
  • 4
  • 24
  • 27
13
votes
2 answers

Zlib compression Using Deflate and Inflate classes in Java

I want trying to use the Deflate and Inflate classes in java.util.zip for zlib compression. I am able to compress the code using Deflate, but while decompressing, I am having this error - Exception in thread "main"…
Ashish Agarwal
  • 14,555
  • 31
  • 86
  • 125
13
votes
1 answer

Is any reason why Rack::Deflater gzip is not enabled by default in Ruby on Rails?

Is any reason why Rack::Deflater gzip is not enabled by default in Ruby on Rails? What are the downsides of gzip for rails, if there is any?
Razvan Pavel
  • 321
  • 2
  • 9
13
votes
2 answers

Trying to understand zlib/deflate in PNG files

I'm currently in the middle of writing a small PNG image I/O library myself for learning purposes. My problem is the following: I created a small PNG only 2 by 2 pixels in dimension and opened it in a hex editor to study its contents. This is the…
Rafael Pasquay
  • 328
  • 4
  • 11
13
votes
4 answers

DeflateStream doesnt work on MemoryStream?

I have the following piece of code: MemoryStream resultStream = new MemoryStream(); string users = ""//Really long string goes here BinaryFormatter bFormatter = new BinaryFormatter(); using (MemoryStream assignedUsersStream = new MemoryStream()) { …
Leonardo
  • 10,737
  • 10
  • 62
  • 155
11
votes
1 answer

Enabling compression on Heroku using python

Google now penalizes due to not being so mobile friendly. So in an effort to make things better, it recommends I compress a lot of my Javascript with Gzip or Deflate. I've seen some old recommendations on stack overflow, but there is nothing out of…
disruptive
  • 5,687
  • 15
  • 71
  • 135
11
votes
2 answers

What's the most that GZIP or DEFLATE can increase a file size?

It's well known that GZIP or DEFLATE (or any compression mechanism) can increase file size sometimes. Is there a maximum (either percentage or constant) that a file can be increased? What is it? If a file is X bytes, and I'm going to gzip it, and I…
SRobertJames
  • 8,210
  • 14
  • 60
  • 107
11
votes
3 answers

DeflatorInputStream and DeflatorOutputStream do not reconstruct the original data

I want to compress some data, so I came across the DeflatorInputStream & DeflatorOutputStream classes. However, the following example shows that I can't seem to reconstruct my original data when using these classes. When I switch to a ZipInputStream…
DieterDP
  • 4,039
  • 2
  • 29
  • 38
10
votes
3 answers

deflate and inflate (zlib.h) in C

I am trying to implement the zlib.h deflate and inflate functions to compress and decompress a char array (not a file). I would like to know if the following syntax is correct ? Am I missing something or defined something incorrectly ? char a[50] =…
Jane Watson
  • 545
  • 2
  • 8
  • 13
10
votes
1 answer

How to decode the IDAT chunk of a PNG file with no compression

I created a few 4x4 pixel, 16-bit grayscale, images in Photoshop and saved them as non-compressed, no interlace, PNG files. I am trying to write a program to extract the image data from these files but I have become a bit confused with the IDAT…
Kevin Baker
  • 139
  • 1
  • 7
10
votes
4 answers

How to pre-compress very large html files

I need to pre-compress some very large html/xml/json files (large data dumps) using either gzip or deflate. I never want to serve the files uncompressed. They are so large and repetitive that compression will probably work very very well, and while…
ftrotter
  • 3,066
  • 2
  • 38
  • 52
1
2
3
39 40