toy / image_optim

Optimize images using multiple utilities
https://github.com/toy/image_optim
MIT License
1.52k stars 109 forks source link

Introduce the Guetzli JPEG encoder #145

Closed ignisf closed 2 years ago

ignisf commented 7 years ago

Hello,

This is my take at implementing support for Guetzli.

At this time there are a few compatibility issues that come with it:

toy commented 7 years ago

Thank Petko, I'll check guetzli. c5cf219e9a505407fe5b2f483180fb61b1720bbc should help with appveyor

ignisf commented 7 years ago

Rebased.

Tried to add it to the pack, too, but I'm running into a very stupid issue -- there's a directory named guetzli in guetzli's top level source dir, so I cannot symlink the binary the way the other binaries are symlinked due to a name conflict.

ignisf commented 7 years ago

The dependency on gflags has been removed upstream https://github.com/google/guetzli/commit/225f6b6174ace348f9950c0630263759bd2b3281 https://github.com/google/guetzli/pull/97

ignisf commented 7 years ago

Will be working on this during the weekend.

ignisf commented 7 years ago

As it is also memory expensive, it may be better to add an option to limit concurrency of its worker (using SizedQueue?).

@toy, could you expand on the way you imagine this being implemented?

toy commented 7 years ago

About limiting concurrency — something like guetzli worker option for maximum concurrent files that this worker is allowed to process, 1 by default. SizedQueue seems like an easy way to handle this, unless you know an easier way.

I'll think if I can come up with something better than disabled_by_default

codeholic commented 6 years ago

What's the status of this pull request? Any help needed?

toy commented 6 years ago

@codeholic I would say it is in waiting state, few changes are still wanted. I've created support for the binary to image_optim_pack, but did not yet release it. And unfortunately guetzli itself did not release a new version for half a year, which is a bit worrying given its popularity.

ignisf commented 6 years ago

@codeholic, I couldnt quite figure out how to limit the concurrency issue outlined by @toy, so we're indeed in a waiting state

toy commented 6 years ago

@ignisf As there is only one instance of worker, the optmize method should block if it is currently running more than n times.