piet
piet copied to clipboard
Add mozjpeg support
I wrote "quick and dirty" support for compression with mozjpeg. It checks if a mozjpeg
command is available, if not it falls back on jpegoptim. You need to compile the binaries yourself, they are not provided by the piet-binary gem.
Maybe it's an idea to introduce a configuration file which can be used to specify the used optimizers, it's binary paths and specific optimizer flags. Don't know if you want to go that way with this project?
Hi @rolandboon,
Thanks for your proposal! I like that we can expand the possibilities of piet
in order to use multiple optimizers.
The only thing I don't like is not leaving to the user the power to choose. What happens if I have both jpegoptim
and mozjpeg
installed in the machine and I want to use the first one?
I will gladly accept this PR when you can manage to allow this to happen. Somehow leaving the user some chance to choose one tool or the other one, and defaulting to jpegoptim
in case nothing is specificly said in order to guarantee backwards compatibility.
Any ideas?
I agree with your issue, that's why i mentioned: Maybe it's an idea to introduce a configuration file which can be used to specify the used optimizers, it's binary paths and specific optimizer flags.
Shall I set something up like that using this pattern?
I'm also interested in this. Would this be an option if it were configurable?
Hi @rolandboon and @aried3r,
I'll accept this option for sure, as long as it is configurable and the gem user can choose whether to use one or the other.
Can anyone come up with a working solution?
I'm not sure I have the time right away. But since piet, or at least piet-binary aims to be a simple solution, do you think you can add the mozjpeg binaries to it?
Hi @aried3r,
To what purpose would adding the binaries be useful for? I understand the goal is to offer this binary functionality as an additional option to piet, but not just the binaries.
Best,
but not just the binaries
Absolutely, I wasn't clear. I'd love to have optional support in piet, but also the option to easily install the binary with piet-binary. I'm not sure when I'll find the time to add a configuration option, though.
Hi @aried3r,
Good then. I don't have much time either, but if you do some day, I'll gladly merge it.
Best,
That would be a great feature :)