-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
image media: add parameter to enable interlaced mode (to get progressive jpegs) #984
Comments
Progressive is actually enabled by default already.. Look in
|
That doesn't work for me (I checked my Explicitly enabling progressive with an url parameter works though, i.e. Can someone reproduce it, i.e. is it a bug? Otherwise I'll have to have another look at my setup. |
Does sound like a bug. As that should work. |
If I got it right this is the function applying the default filters: Last commit message of
Maybe the filter function wasn't adapted to that? Or does default filters mean: only apply to images that don't specify any filters? Anyway it doesn't work in that case either (I think). |
I did some more testing (on Nginx and Apache) and if I do
it works, but if I instead do
it doesn't. The order of the rules matters. So maybe the reason why the default |
it's weird, when I debug, the enableProgressive is applied to all images because it's in my base configuration as a default filter. This is is on a bare-bones setup. Do you have the configuration overridden with |
I just cloned the grav repo to my server, did a I noticed that I head So I logged into admin, cleared all cache, deleted the two empty yaml files, tried again... still not progressive. At first when I created the issue, I tested it on another server (vps, Nginx instead of Apache) and it behaves the same there. How do you check if the image is progressive? |
I just checked my fresh install again and noticed that if I don't put any parameters, the image url on the parsed page is Then I also included |
Well after I just had a look again and noticed that you didn't specify an alt text, I tried that as a third image on my page ( Quite a mean bug... |
Ok turns out using
This works.. however:
Does not work. I'm going to move the filters to the 'save' rather than the creation of the image so it's automatically applied at the end. |
I'm having a similar issue while outputting images with Twig in templates. |
I like to use progressive jpegs on my sites, but when using Grav's methods like
?cropResize
they become baseline ("normal") jpegs.From the notes in http://php.net/manual/en/function.imagejpeg.php:
So my suggestion is to add a new url parameter
?interlaced
with possible valuestrue
/false
(oron
/off
), which (according to http://php.net/manual/en/function.imageinterlace.php) should do something like:As it is not suggested to use interlacing with pngs or gifs (see this stackoverflow answer), it may be better to make a parameter like
?progressive=true
instead, which only applies if the file type isjpg
. On the other side s.o. might want to use interlaced pngs for some reason. It could then be stated in the docs that is only suggested for jpegs.If you like it and want me to create a PR for that (add it to the existing image actions), I can do it but it might take me a few weeks until I have the time.
TL;DR: Something like
or
would be nice!
The text was updated successfully, but these errors were encountered: