Questions tagged [zlib]

zlib is a library used for data compression. Also a crucial component of many software platforms including Linux, Mac OS X, and the iOS

zlib is a library (current version: 1.2.8, released April 28, 2013) that is very widely used for doing data compression. It is open source software written in C, and is unencumbered by patents. It supports three principal compression formats:

  • format Raw compressed data
  • format data (essentially just raw data with a small header)
  • format data (the raw data with a considerably more sophisticated header)

Documentation may be found in RFC-1950 (zlib), RFC-1951 (deflate), and RFC-1952 (gzip).

The zlib library was created by Jean-loup Gailly and Mark Adler.

2362 questions
57
votes
9 answers

How to decompress Gzip string in ruby?

Zlib::GzipReader can take "an IO, or IO-like, object." as it's input, as stated in docs. Zlib::GzipReader.open('hoge.gz') {|gz| print gz.read } File.open('hoge.gz') do |f| gz = Zlib::GzipReader.new(f) print gz.read gz.close end How should…
Fluffy
  • 27,504
  • 41
  • 151
  • 234
55
votes
9 answers

pyenv zlib error on MacOS:

My goal I am trying to install Python 2.7.5 and 3.6.5 side-by-side on my MBP with with pyenv. pyenv Installation Following How can I use Homebrew to install both Python 2 and 3 on Mac? , I tried: $ pyenv install 3.6.5 Which erred…
Adam Matan
  • 128,757
  • 147
  • 397
  • 562
55
votes
6 answers

brew install zlib-devel on Mac OS X Mavericks

Attempting to install the zlib-devel on mac os x mavericks with homebrew doesn't work: brew install zlib-devel Error: No available formula for zlib-devel Searching taps... This install brew install zlib works fine though.
Ivan
  • 7,448
  • 14
  • 69
  • 134
54
votes
8 answers

RVM Ruby 1.9.1 install can't locate zlib but its runtime and dev library are there

Trying to get Ruby 1.9.1 up and running with RVM on a fresh install (fedora). After doing rvm install 1.9.1, the rubygems error logs show that zlib can't be located no such file to load -- zlib (LoadError) However both the zlib runtime and…
Casper
  • 541
  • 1
  • 4
  • 3
54
votes
4 answers

How to download and unzip a zip file in memory in NodeJs?

I want to download a zip file from the internet and unzip it in memory without saving to a temporary file. How can I do this? Here is what I tried: var url =…
pathikrit
  • 32,469
  • 37
  • 142
  • 221
48
votes
2 answers

Error: 'zlib' is an invalid command

How can I run this command in OSX? dd if=mybackup.ab bs=24 skip=1|openssl zlib -d > mybackup.tar When I run this I get the following errors $ dd if=mybackup.ab bs=24 skip=1|openssl zlib -d > mybackup.tar dd: mybackup.ab: No such file or…
Jack Shultz
  • 2,031
  • 2
  • 30
  • 53
48
votes
2 answers

Simple way to unzip a .zip file using zlib

Is there a simple example of how to unzip a .zip file and extract the files to a directory? I am currently using zlib, and while I understand that zlib does not directly deal with zip files, there seems to be several additional things in zlibs's…
judeclarke
  • 1,106
  • 5
  • 16
  • 31
46
votes
4 answers

Compression and decompression of data using zlib in Nodejs

Can someone please explain to me how the zlib library works in Nodejs? I'm fairly new to Nodejs, and I'm not yet sure how to use buffers and streams. My simple scenario is a string variable, and I want to either zip or unzip (deflate or inflate,…
Eli
  • 2,666
  • 7
  • 33
  • 37
44
votes
4 answers

Incorrect Header Check when using zlib in node.js

I am trying to send a simple HTTP POST request, retrieve the response body.Following is my code. I am getting Error: Incorrect header check inside the "zlib.gunzip" method. I am new to node.js and I appreciate any help. ; fireRequest:…
Thusitha Nuwan
  • 561
  • 1
  • 4
  • 4
44
votes
2 answers

How to read a single file inside a zip archive

I need to read the content of a single file, "test.txt", inside of a zip file. The whole zip file is a very large file (2gb) and contains a lot of files (10,000,000), and as such extracting the whole thing is not a viable solution for me. How can I…
e-info128
  • 3,727
  • 10
  • 40
  • 57
42
votes
5 answers

How to compress a buffer with zlib?

There is a usage example at the zlib website: http://www.zlib.net/zlib_how.html However in the example they are compressing a file. I would like to compress a binary data stored in a buffer in memory. I don't want to save the compressed buffer to…
Richard Knop
  • 81,041
  • 149
  • 392
  • 552
42
votes
14 answers

Brew doctor: dyld: Library not loaded & Error: No available formula for zlib

When I brew doctor I get the following errors: dyld: Library not loaded: /usr/lib/libltdl.7.dylib Referenced from: /usr/local/bin/php Reason: image not found Error: No available formula for zlib The file libltdl.7.dylib is not in my /usr/lib…
Ryan
  • 6,027
  • 16
  • 52
  • 89
41
votes
2 answers

Python decompressing gzip chunk-by-chunk

I've a memory- and disk-limited environment where I need to decompress the contents of a gzip file sent to me in string-based chunks (over xmlrpc binary transfer). However, using the zlib.decompress() or zlib.decompressobj()/decompress() both barf…
user291294
  • 413
  • 1
  • 4
  • 5
39
votes
4 answers

Decompress gzip and zlib string in javascript

I want to get compress layer data from tmx file . Who knows libraries for decompress gzip and zlib string in javascript ? I try zlib but it doesn't work for me . Ex , layer data in tmx file is :
Toan Nguyen
  • 1,043
  • 3
  • 13
  • 24
38
votes
5 answers

What easy zlib tutorials are there?

I'm looking for a good tutorial on zlib. I'm interested only in decompressing the archives. I also want to know how I can access a desired file inside an archive, preferably by filename alone, if that can be done in zlib at all.
Paul Manta
  • 30,618
  • 31
  • 128
  • 208