felixhaeberle/kirby3-webp

webp is not displayed in the browser

Closed this issue · 11 comments

Hey,

thank you for the great plugin. I installed it according to your instructions and also adjusted the htaccess.
When I upload a jpeg file the webp version is created and stored in the content folder. But not displayed in the browser.
There is no webp file in the media folder either.

It only works when I upload a webp file directly.
What am I doing wrong?

Kirby Version 3.5.1

Thank you!
Stefan

I realized a lot of changes in v3.5, so maybe the plugin doesn't work with this new version. I do my best to check this an provide an update or better a fix on this asap.

I would love to review a pull request if somebody already has an fix for this bug.

Thank you for the answer and your work :-)

Looks like uploaded images are converted to webp in the uploaded folder, but not in the media cache folders. Maybe that's the reason?

Do you setup your server correctly? Is it possible that it has something to do with the new mime type handling? I just stumbled over this addition in 3.5.0, that you can now specify mime types in the file blueprints. Maybe .webp files get ignored there.

I'm not sure if my server is configured correctly. (I am not an expert or developer. It is a Webserver by all-inkl.com)

I implemented all the settings as described (config and htaccess).

I tested it with the Kirby "Starterkit".

In image.yml I added the following: extension: jpg, jpeg, png, webp

Now webp are also saved in the media folder. But in a seperate subfolder not in the one in which the jpg version is saved.

Example:

media / page / test / 17d2482dfe-1612623860 / image.jpg
media / page / test / b81e1a0b80-1612623860 / image.webp

The jpg version is displayed in the front end.

Thank you!
Stefan

Doesn't really seem to work at the moment for me with the newest Kirby version, following the instructions.

Same problem for me here too. The Webp file is created but not added to the media folder.

Dear Felix,
i stumbled upon the same issue as the last three people:
I upload a new image, after configuring the plugin as mentioned in the readme and LordCanis told.
The webp-image lys then in the upload-folder with the same name:

content/shutterstock_1013226316_2560w.jpg
content/shutterstock_1013226316_2560w.webp

In the media folder there's not such a thing (even not in the subdir):
grafik

I wonder wherefrom the jobs folder comes, since i do not use this slug anywhere.
(But may not have to do something with that one)

Thank you, Sam

Hi Felix,

i made one more try:
I copied the webp-image from the upload to the front-end path and gave it the very same name.
Firefox still fetches the jpg-variant.
This would be because these lines would'nt do the job exactly:


    # Checking for WebP browser support ..
    RewriteCond %{HTTP_ACCEPT} image/webp

    # .. and if there's a WebP version for the requested image
    RewriteCond %{DOCUMENT_ROOT}/$1.webp -f

    # Well, then go for it & serve WebP instead
    RewriteRule (.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]

I do not have another clue.

But first things first: I hope you can find out something about the proper file-locations in the media-folder .

Furhter, how can i configure if the "lossy" or "lossless"-addition to the filename is attached or not? I guess, this would break the apache rewrite rule, or?

Thank you, Sam

@subnoodle Can you try with version v2 of the plugin which just got released?
In case it doesn't work, please reopen this issue.

Hi Felix, it did not change the behavior, that no copy is put to the media-folder.
Tried the 2.0 now.