-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Think the custom_zlib api is incomplete. #190
Comments
This isn't always a generic decompress where the decompressed size is totally unknown. This is decoding known rows of known size, so the memory is allocated ahead of time. So the decompress should hand down the buffer to fill in. I also couldn't get miniz to work either with this api. |
This does everything I'd expect for custom_zib, but is commented out by LODEPNG_NO_COMPILE_ZLIB. So I guess I'll leave in zlib by not setting that, and still supply the custom_zlib impl.
|
Failures on iccp blocks (which passes 16K for size, even though ony 4506 bytes are decompressed). So then my decompressor returns an error. Not sure why this doesn't fail with the default zlib_decompress. I did get libCompression working by +2 on ptr, and -2 on size. But then iccp block broke all this. So just went back to default decompress in lodepng. https://github.com/alecazam/kram/blob/main/libkram/kram/Kram.cpp
|
I'm trying to override the deflate algorithm in libpng by defining custom_zlib. I have a this using libCompression on macOS. But it needs the buffer allocated and size to pass to the decompression. libpng has expected_size, but doesn't pass this down to custom_zlib.
Even the default impls allocate a vector, and then call deflatev on it.
This receives a nullptr for dstData, and 0 for dstDataSize. So then the callback can't call the decompression. Can't pass nullptr, and can't pass 0 to the libCompression code.
Here's where expected_size exists.
And here is where expected_size is dropped, and outData isn't allocated. lodepng already knows what the size is supposed to be, and can allocate the buffer, and have this fill in each row of the png.
The text was updated successfully, but these errors were encountered: