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

Please add support for in-place file compression #140

Open
debajit opened this issue Dec 4, 2017 · 2 comments
Open

Please add support for in-place file compression #140

debajit opened this issue Dec 4, 2017 · 2 comments

Comments

@debajit
Copy link

debajit commented Dec 4, 2017

I use zopfli for compressing assets before serving them on a CDN.

For a file like app.css, when zopfli compresses it, it creates app.css.gz.

It would be really helpful for many use-cases if we had a command-line option for zopfli that would create the compressed file with the same name. (i.e. app.css)

@CounterPillow
Copy link

See #61

Also you can sorta do this with zopflipng -y file file

@lvandeve
Copy link
Collaborator

lvandeve commented Dec 4, 2017

Zopfli takes an uncompressed file and writes to a compressed file (unlike zopflipng which turns a PNG into another PNG), which is why it adds .gz to the filename (similar to the gzip tool). If overwriting the uncompressed file with a compressed file is an interesting use case though, I can look into it. Thanks for the suggestion.

For now, could something like this work? zopfli app.css -c > /tmp/app.css && mv /tmp/app.css app.css, or, zopfli app.css && mv app.css.gz app.css

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

No branches or pull requests

3 participants