mozilla / mozjpeg

Improved JPEG encoder.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No output file if identical to input file

FredWahl opened this issue · comments

I have created a program that automates jpegtran. The output file should be optimised using the recommended flags. The problem is that there are many files and new files are being added so there’s no way of knowing which files have been optimised. It takes time so it would run faster when it tries to optimise something that already has been optimised. I simply look at the filsesizes and if they are different, I overwrite the input file. If they are equal, nothing has changed, and then I delete it.

I think it’s fairly common that you run jpegtran multiple times on files with settings such that jpegtran does nothing other than creating an identical output file. If you have a web site where pictures are added all the time then you have this problem.

Cheers,
Fredrik