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

recompressing small files can result in creating larger files #100

Open
pavelxkrejci opened this issue Oct 27, 2018 · 0 comments
Open

recompressing small files can result in creating larger files #100

pavelxkrejci opened this issue Oct 27, 2018 · 0 comments

Comments

@pavelxkrejci
Copy link

Metadata added by jpeg-recompress can outweight the savings from recompression of small files. The logic for output size calculation and checking ignores size of all metadata and this can result in creating output files larger then original files in some cases.
Example file included: m
Command used:
jpeg-recompress -l 10 -c -a -q high m.jpg m-out.jpg

I'm also including diff file with my fix.
jpeg-recompress.c.diff.txt
The fix also uses minDelta constant which is the minimum required savings in bytes for the new file to be created. I wanted to avoid useless recompressions with 1 byte improvement. This might be improved to be configurable via parameter.

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

1 participant