Questions tagged [miniz]

miniz.c is a lossless, high performance data compression library in a single source file that implements the zlib (RFC 1950) and Deflate (RFC 1951) compressed data format specification standards.

Miniz is a lossless, high performance data compression library in a single source file that implements the zlib (RFC 1950) and Deflate (RFC 1951) compressed data format specification standards. It supports the most commonly used functions exported by the zlib library, but is a completely independent implementation so zlib's licensing requirements do not apply.

Features

  • MIT licensed
  • A portable, single source and header file library written in plain C
  • Tested with GCC, clang and Visual Studio.
  • Easily tuned and trimmed down by defines
  • A drop-in replacement for zlib's most used API's

See the miniz repository on GitHub

11 questions
6
votes
1 answer

How to use miniz to create a compressed file that can be decompressd by gzip?

I'm writing a program in C++, on windows platform. I would like to compress some data storing in a char[] array, and output it to a file, and later I will upload the file to a unix server and I want it can be decompressed by gzip -d. After a lot of…
1
vote
1 answer

zlib/miniz: how to configure inflate for very low memory usage?

I have an embedded system with low amounts of memory which needs to inflate zlib-deflated data packets coming from server-side. The deflation can use all the resources it wants, but for the inflation I'm limited to less than 5 kB. The deflated data…
1
vote
1 answer

DATA_ERROR when reading zlib/miniz deflated data

I am writing a simple C++ wrapper for miniz-cpp's implementation of zlib compression. I got deflation to work, but now I have a problem with inflating the data again. Code I have a test case which (grossly simplified) boils down to: ByteArray…
Jan Schultke
  • 17,446
  • 6
  • 47
  • 96
0
votes
0 answers

compression level using miniz having no effect

I'm evaluating using the low-level routines in miniz and testing different compression levels with differently sized inputs. Level 0 always gets a little bit larger (as expected) but the other levels all result in the exact same size for the same…
Dix
  • 106
  • 4
0
votes
1 answer

How to get size of uncompressed gzip file using flate2

I want the uncompressed size of a gzipped file using rust crate flate2. How do I ask a GzDecoder or MultiGzDecoder for the uncompressed file size without reading the entire file? I'm hoping for a simple function call like header.filesz(): use…
JamesThomasMoon
  • 6,169
  • 7
  • 37
  • 63
0
votes
1 answer

miniz C can't zip file with absolute path

I'm using miniz to create a .zip file in C, on Windows. I used the doc to produce my code and it works. I can create an archive with the files I want, ONLY if I give relative path to the zip function. I don't get why the "file_name" variable must be…
GemsKnight
  • 75
  • 1
  • 9
0
votes
1 answer

What guarantees does zlib's inflate/deflate make about avail_in and avail_out?

What guarantees does zlib give on the state of avail_in an avail_out after a call to inflate? I am seeing peculiar behaviour with miniz that I want to make sure is not a misunderstanding of the zlib API. Effectively, after calling inflate, I have…
drglove
  • 638
  • 1
  • 6
  • 21
0
votes
1 answer

Decompressing a vector into another vector using miniz in c++

I'm trying to do the simplest thing here. I want to create a method that will take in a byte (char) array, inflate it using miniz tinfl_decompress method and then return a byte array containing the inflated data. First things first. The arrays given…
Karlovsky120
  • 6,212
  • 8
  • 41
  • 94
0
votes
1 answer

Swift inflated [UInt8] fails to deflate with miniz lib

I have an iOS app where I use DeflateSwift to deflate a byte array ([UInt8]). When I try to inflate this data using the miniz library it is not working. This is executed in another platform. The DeflateSwift is a very simple wrapper around the zlib…
Johan Karlsson
  • 1,136
  • 1
  • 14
  • 37
0
votes
0 answers

Compress a file chunk by chunk - miniz

I'm building a program with help of the library [miniz][1] for compressing files with sizes up to 3GB. The computer that will run this program will also run another (heavy) application and therefore I want this compressing program to load a chunk of…
Bojack
  • 459
  • 1
  • 5
  • 18
-1
votes
1 answer

Appending to a file in a zip archive

I have written a zip class that uses functions and code from miniz to: Open an archive, Close an archive, Open a file in the archive, Close a file in the archive, and write to the currently open file in the archive. Currently opening a file in an…
Will M
  • 19
  • 2