getzola / zola

A fast static site generator in a single binary with everything built-in. https://www.getzola.org
https://www.getzola.org
MIT License
13.48k stars 943 forks source link

Feature request: Encode resize_image JPEGs as Progressive #953

Open BezPowell opened 4 years ago

BezPowell commented 4 years ago

Currently any JPEGs processed by the resize image function seem to be encoded as baseline. Perceptually, progressive JPEGs seem to load a lot faster (especially over slower internet connections) and can in many cases even have a smaller file size as well.

I don't know how much work it would be to get the resize_image function to encode as progressive by default, or even add an option for it, but it would be a nice enhancement to an already fantastic static site generator.

Keats commented 4 years ago

Is there a downsite to encoding them as progressive? Is it supported by the image crate?

BezPowell commented 4 years ago

It looks like small images (> 10k) often have a slightly larger filesize when encoded as progressive. Unfortunately, it doesn't look like the image crate supports encoding as progressive, only decoding. I'll add a feature request there and see what the likely difficulty of implementing it would be.

Keats commented 4 years ago

Issue on the image repo: https://github.com/image-rs/image/issues/1154

donovanglover commented 3 years ago

Would jpeg-encoder work here? The README says it supports progressive compression.

Keats commented 3 years ago

Has anyone tried it? It would be nice. cc @vojtechkral

vojtechkral commented 3 years ago

Will have a look. If jpeg-encoder can take data from image, it shouldn't be a problem...