mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
Do not emit compressed files larger than the input #319
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dilyanpalauzov on GitHub (Apr 23, 2020).
As a matter of fact I want to compress all text files on a webserver, so that these are served compressen on Accept-Encoding. As a matter of fact, an uncompressed file of 41 bytes is compressed to 46 bytes. when the output is bigger than the input, the output file shall not be created by default.
@eustas commented on GitHub (Apr 23, 2020):
That is why I do the following thing:
I.e. remove files that become bigger.
@dilyanpalauzov commented on GitHub (Apr 23, 2020):
It would be just better, if the brotli binary implictly does not create output files, that are bigger than the input. Not everybody is smart enough to clean afterwards the inversed compression.
@eustas commented on GitHub (Apr 23, 2020):
It is easy to do, but that should not be the default behaviour (e.g. remain consistent with other compressors). Please consider filing the issue in google/brotli repo.
@dilyanpalauzov commented on GitHub (Apr 23, 2020):
Isn't alreasy there?
If it shall not be the default behaviour then add a command line parameter for this.
@eustas commented on GitHub (Jul 2, 2020):
Sorry, was busy with different project and has responded with nonsense. Yup, you are at right place. And yes, this should be a command line parameter.
Though it will rather remove the output file, if it is bigger than input... Otherwise it would require working with temporary file, and thus might lead to non-trivial corner cases.
Still not sure, when I will have time to do it...
@eustas commented on GitHub (Aug 3, 2023):
Should be fixed with #1036