piet icon indicating copy to clipboard operation
piet copied to clipboard

Add mozjpeg support

Open rolandboon opened this issue 9 years ago • 9 comments

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?

rolandboon avatar Jul 03 '15 12:07 rolandboon

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?

albertbellonch avatar Jul 05 '15 20:07 albertbellonch

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?

rolandboon avatar Jul 20 '15 11:07 rolandboon

I'm also interested in this. Would this be an option if it were configurable?

aried3r avatar Mar 30 '16 09:03 aried3r

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?

albertbellonch avatar Mar 30 '16 10:03 albertbellonch

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?

aried3r avatar Mar 30 '16 14:03 aried3r

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,

albertbellonch avatar Apr 01 '16 15:04 albertbellonch

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.

aried3r avatar Apr 15 '16 08:04 aried3r

Hi @aried3r,

Good then. I don't have much time either, but if you do some day, I'll gladly merge it.

Best,

albertbellonch avatar Apr 15 '16 13:04 albertbellonch

That would be a great feature :)

pavelloz avatar Aug 30 '16 09:08 pavelloz