Skip to content
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

Some more-featured Zlib emulation #14

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

Scondo
Copy link

@Scondo Scondo commented Dec 5, 2021

I wrote this few years ago and almost forgot about it.

I hope you'll find it useful.

I add unittest from Python 3.10 to check if emulation is ok. It fails, but mostly on dictionary feature and difference between single and iterative compression.

@Scondo
Copy link
Author

Scondo commented Dec 5, 2021

Note: I use 'y' type for type conversion in C-Api so it can't be compiled with Python 2.7

kwargs['gzip_mode'] = 0
return zopfli.zopfli.compress(data, **kwargs)
return zopfli.zopfli.compress(bytes(data), **kwargs)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this for some unittest.
Maybe change to 'y' in C code will be better solution, but this depends on compatibility with 2.7

It was easier than I thought...
*Don't know if it really improves compression efficiency, may be more tests required.
…'s not part of API.

ZopfliCompress does not provide enough options to do partial compression. So we should use zopfli source.
Almost sure it will be not compatible with system zopfli, so disable at least for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant