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
2,206
questions
0
votes
1
answer
34
views
How to append to a zlib stream?
I have been trying to append raw bytes to an existing zlib stream using the deflatePrime function provided by the zlib library. However, i cannot understand what the second and third parameter of ...
0
votes
0
answers
47
views
clang-14: warning: cannot compress debug sections (zlib not installed) [-Wdebug-compression-unavailable] while using address sanitizer
I have a sample C++ program that would cause an obvious segmentation fault.
test.cxx:
int main()
{
int* ptr{nullptr};
*ptr = 3;
}
So I am using address sanitizer to debug it:
metal888@ThinkPad:~$ ...
0
votes
1
answer
31
views
python gzip.open: zlib.error: Error -3 while decompressing data: too many length or distance symbols
I want to decompress a huge gz file (wikidata json dump latest-all.json.gz
, 104GB compressed) on the fly in python with gzip.open.
It works fine for a while. However, after reading 39.7 million lines ...
0
votes
1
answer
69
views
Is there a way to upload the byte type created with zlib to Google bigquery?
I want to input string data into bigquery by implied by pyhton's zlib library.
Here is an example code that uses zlib to generate data:
import zlib
import pandas as pd
string = 'abs'
df = pd....
0
votes
0
answers
7
views
Is it necessary to update OpenCV & ZLib Libraries?
Is it necessary for an android - kotlin project to update its OpenCV & Zlib libraries ? It seems their current versions in my project are :
OpenCV : 4.0.1
ZLib : 1.2.8
If so , what is the best ...
0
votes
1
answer
37
views
puff.c How does the huffman decoding work?
I am trying to decompress a raw DEFLATE data stream in order to understand, how the DEFLATE decompression works. I don't care for performance at the moment. I just want to understand the decompression ...
0
votes
1
answer
45
views
zlib deployment breaks Ubuntu
I'm trying to use zlib as a dependency on a C++ project. For instance, i'm trying to build the zlib 1.2.8 with make on Ubuntu 20.04 LTS. I'm using the following command line:
./configure --enable-...
0
votes
0
answers
24
views
Why is ```(n+1)(BASE-1)``` added when calculating the NMAX of Adler-32?
zlib/adler32.c
code is:
#define BASE 65521U /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
but I think it ...
2
votes
1
answer
51
views
Python how to get length of data compressed with zlib?
I have a file with multiple zlib-compressed binary data, and the offsets and lengths are unknown. Below, I have a script that gets the offset of the byte after the final zlib compressed data, which is ...
0
votes
1
answer
53
views
Python how to store last element in yield iterator?
I have the following code:
import zlib
def inflate(infile):
data = infile.read()
offset = 0
while offset < len(data):
window = data[offset : offset + 2]
for key, value ...
0
votes
0
answers
20
views
nodejs extract/decompress all content of .gz compressed files to directory
i have a file in the file system named temp.gz
the temp gzip file contains files and folder
i would like to extract them and have them in a folder like we would normally unzip a file in OS.
i have ...
0
votes
1
answer
44
views
Failed to unarchive file which compressed by c++ zlib.h
Compress string (i tried to compress file but it didnt help) and save compress data to file:
#include <iostream>
#include <fstream>
#include <zlib.h>
int main() {
char a[50] = &...
-2
votes
1
answer
81
views
Decompress string compressed by php's gzcompress()
So I have data compressed in php in this way:
$compressed = gzcompress($pairs, 9);
When I try to decompress obtained data with rust in this way:
let mut d = flate2::read::GzDecoder::new(...
1
vote
2
answers
109
views
How do I compile with zlib on windows using gcc?
My aim is to compile zlib alongside my application files, I use gcc from tdm-gcc and have cloned the repository https://github.com/madler/zlib
in /example there is a zpipe.c file which utilizes the ...
0
votes
0
answers
41
views
Zlib version used in openjdk 11
I am trying to check what zlib version is used for an specific version of openjdk 11 but I can't find it anywhere.
I was googling it but can't find it anywhere. I can just find some tickets in which ...
10
votes
1
answer
631
views
Is there a way to find out which .NET Framework version uses which version of zlib? (in relation to CVE-2018-25032)
I'm trying to work out if we are exposed to the recently reported CVE-2018-25032 vulnerability, as .NET does use the zlib library in the DeflateStream implementation.
I can't seem to find anything ...
1
vote
0
answers
84
views
Include and use libpng to C program using CMake [Windows]
Hi im trying to include libpng in my C program using CMake (p.s im new to CMake). I want to use it to generate png of the qrcode generated by libqrencode. What I have done so far:
1. Install zlib ...
0
votes
0
answers
76
views
RubyZip doesn't work well after updating zlib to v.1.2.12
I have updated zlib from 1.2.11 to 1.2.12. After this updating, RubyZip doesn't work well, The following code generates a zip file includeing a empty file named test.txt. In the environment using ...
0
votes
1
answer
74
views
Extract data from axios body array buffer response
I am calling an API that returns a gzip file in it's body. The problem I am having is I don't know how to extract specific data from that csv file as I need to use it further in my code. This is my ...
0
votes
0
answers
43
views
Swift compression zlib level=1 - or if default compression level is to good
know anyone a Swift library to compress with zlib algorithm level=1 ?
Apple only support level=5 with COMPRESSION_ZLIB but sometime - now - I need exactly a different level in result of compatibility ...
0
votes
1
answer
88
views
zlib error -3 while decompressing archive: Incorrect data check
I am writing a C++ library that also decompresses zlib files. For all of the files, the last call to gzread() (or at least one of the last calls) gives error -3 (Z_DATA_ERROR) with message "...
0
votes
1
answer
64
views
How to read and decode zlib block and deflate block in a png image file
Recently I started writing a png decoder for fun.And for understanding the format and compression I have read the following
PNG (Portable Network Graphics) Specification, Version 1.2)
RFC 1950("...
0
votes
0
answers
35
views
zlib gzread does not decompress entire file
I'm trying to write a function that can decompress a gzip-compressed file with zlib. The file I am trying to decompress is 294 bytes compressed, and I am able to decompress it with 7zip to give me a ...
-1
votes
1
answer
44
views
Link dll against static build of QuaZip using Qt5.12 in VS2017
I'm trying to link a .dll against a static builld of QuaZip library to get rid of the quazip.dll dependency at runtine. Since I've ran into a dependency conflict at production because a customer is ...
1
vote
1
answer
71
views
zlib decompression invalid distances set
./minigzip: my_file_name.gz: invalid distances set
Downloaded the code from https://github.com/madler/zlib, and tested with different versions of zlib with the command:
git reset --hard && git ...
0
votes
1
answer
34
views
How to force GZIP to read file when CRC check fails
I'm reading a bunch of gzip compressed files in Python using the gzip module. Unfortunately some of them fail the CRC check, so I'm looking for ways to go around this problem. Looking around ...
0
votes
1
answer
115
views
How to fix "cannot find -lz"
I am working on code have Zlib.h header, This header is found in my code folder, I compile this code by using
gcc -o x xx.c -lz
but I get on this
/usr/bin/ld: cannot find -lz
collect2: error: ld ...
0
votes
1
answer
46
views
How to decode b'a\xXX format
I'm trying to read data from .db3 file, this is how I get each row in database
.db3 the table is MBinary and the column is five_bboxes (https://i.stack.imgur.com/DiN96.png)
con = sqlite3.connect(...
0
votes
0
answers
39
views
NodeJS Gunzip "Error: invalid distance too far back" for larger files
I'm trying to process some audit data using MongoDB Atlas Log API which returns a .gz file. This works for very small files (<100kb uncompressed / <10kb compressed) but anything larger and "...
1
vote
1
answer
146
views
How to generate zip and put files into zip using stream in Node js
Currently, I tried to make zip file(or any format of compressed file) containing few files that I want to put into zip file.
I thought it would work with adm-zip module.
but I found out that the way ...
0
votes
0
answers
7
views
Getting 'incorrect header check' error when decoding gzipped data from YAML file [duplicate]
I have the following YAML file:
data: !!binary |
H4sIAIDb/U8C/1NW1E/KzNMvzuBKTc7IV8hIzcnJVyjPL8pJ4QIA6N+MVxsAAAA=
The value is ASCII string that represents the following gzipped text:
#!/bin/sh
...
0
votes
1
answer
145
views
Encrypt compressed data using zlib and cryptojs
I'm in node js, trying to compress an object using zlib.deflate and then encrypt it using cryptojs AES.
Then, when I try to get the original value, I fail on the zlib.inflate call with the error: &...
0
votes
1
answer
79
views
C - zlib - png crc32/deflate
I'm doing an homework to read a png file through zlib in C and I always have checksum not equal to png crc. How I shoul take from zlib? I've been on it for 5 hours and I'm going crazy.
Thank you for ...
0
votes
0
answers
95
views
Zlib decompression in react
I am trying to decompress a zlib compressed data in react. I have found some implementation like react-zlib-js or pako-js but no suitable example for implement. I will be of great help if I get any ...
0
votes
0
answers
241
views
Trying to decode zlib compressed and base64 encoded data to a readable format in Python
import zlib, base64
exec(zlib.decompress(base64.b64decode('eJxsvUuu7UizpNfXKG5PJUANP==)))
###The code is short for example only
How can I decode this?
This is a picture of the code
https://prnt.sc/...
0
votes
1
answer
104
views
Data compressed in Swift 5 on macOS/iPhone cannot be decompressed by anything else
I am trying to decompress some JSON (representing a Codable type) that was compressed on an iPhone, using the NSData instance method .compressed(using: .zlib). Note .zlib is the format recommended by ...
0
votes
1
answer
54
views
gzdecode() insufficient memory - size is exhausted
Do you know any solucion to unpack large .gz in php (>200 MB .gz, >4GB original... maybe in packs of >1GB or >2GB inside) ?
Solucion of decode .gz part by part is needed.
Code
gzdecode(@...
0
votes
0
answers
91
views
React-pdf's webpack 5 config inside webpack.common.js file not work (Error: Can't resolve './zlib_bindings')
I'm a junior and my senior is implementing micro-frontend, and there are few webpack files: webpack.common.js, webpack.dev.js and webpack.prod.jslike that. In the project, the react-pdf package is ...
-3
votes
1
answer
48
views
Removing a memory address from standard output in Golang
I am attempting to create a clone of git in Go. I am new to Go, especially the "os" and "io" packages.
Question: Why is my function returning a memory address (or maybe it's the ...
0
votes
1
answer
44
views
Buildozer failed to execute the last command: The headers or library files could not be found for zlib
I have been trying to generate an .apk with buildozer. The .apk is successfully generated, but it crashes each time due to the following error:
setup.py build_ext -v
File "setup.py", line ...
0
votes
1
answer
180
views
How to use zlibwapi instead of zlib for compiling PostgreSQL?
For PostgreSQL, I have compiled zlib 1.2.11 on msvc 2022. After compiling zlib I got following list of files.
Directory of C:\Users\Documents\zlib_build\zlib-1.2.11\contrib\vstudio\vc14\x86\...
0
votes
0
answers
47
views
Is it possible to figure how to decompress a file, knowing its first bytes?
I once downloaded a web page using curl, and the resulting file contains the compressed HTML code. I would like to decompress it.
I tried this Python code
import gzip
f = gzip.open(file_name, 'rb')
...
0
votes
0
answers
54
views
Problem to install some R 4.1 library on Ubuntu 20.04 with depenedence if libcurl and ZLIB (rio, rgl, misc3d)
I have some troubles to install misc3d, rgl and rio` libraries.
When I try install.packages('rgl')
I got this:
Error in dyn.load(dynlib <- getDynlib(dir)) :
unable to load shared object '/usr/...
1
vote
1
answer
77
views
How do I specify the compression type in zlib?
I have this code which uses zlib to compresses a binary string:
f = open("compressed.bin", "wb")
x = zlib.compress(b"Some text to be compressed")
f.write(x)
f.close()
...
0
votes
1
answer
131
views
decompressing git objects with zlib
I decompressed three git objects with this Python script:
import zlib
filename = '/path_to_file'
compressed_contents = open(filename, 'rb').read()
decompressed_contents = zlib.decompress(...
2
votes
1
answer
72
views
Zlib deflate/inflate proper initialization
While using zlib in a "pedantic" way, I have stumbled across a couple inconsistencies I'd like to clear for myself.
For inflateInit(), the manual states:
... The fields next_in, avail_in, ...
0
votes
0
answers
111
views
How to let libpng16.so.16 use libz.so.1 in the local directory ? (Another ZLIB_1.2.9 issue)
When I run a django project, I got the following error:
ImportError: /lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /home/ec2-user/anaconda3/lib/./libpng16.so.16)
I found that that ...
0
votes
0
answers
27
views
How to handle gzip-compressed responses with the gsoap logging plugin; alternately, how to turn off compression completely
UPDATE
I have resolved the issue, at least to my satisfaction. I was using a window size of -15 in inflateInit2, based on other examples I had seen, but this was obviously not correct. Based on a ...
0
votes
1
answer
123
views
Python - faster library to compress data than ZipFile
I am developing a web application in Python 3.9 using django 3.0.7 as a framework. In Python I am creating a function that can convert a dictionary to a json and then to a zip file using the ZipFile ...
0
votes
2
answers
247
views
Bazel C++ how to include a library that needs to be cloned from github then build before it can be linked?
The library I need to use is: https://github.com/madler/zlib .
To install it separately, I can do:
git clone https://github.com/madler/zlib
cd zlib
make
Then I can use it during compilation by ...