Closed (fixed)
Project:
Stage File Proxy
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Sep 2020 at 13:17 UTC
Updated:
12 Jun 2025 at 08:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mattdaniel commentedThis patch is based on the one in the related issue, but has been updated to work with the ImageAPI Optimize WebP module instead.
Comment #3
gregglesThere's a patch so updating status.
Comment #4
geek-merlinPostponing this on the other issue.
Comment #5
markdorisonPatch fails to apply after a change in this commit for D9 support.
I am leaving this marked Postponed per #4, but I am attaching a re-rolled patch with an interdiff for the change I made to get it to keep it in line with the D9 changes.
Comment #6
mherchelNote that WebP support just landed in core See #2340699: Let GDToolkit support WEBP image format.
It would be nice if we could hard-code the webp support in the meantime until #3173364: Provide a hook so modules can provide more "derived-from" candidates lands
Comment #7
gregglesSince there hasn't been much progress on 2340699 it seems like a fine idea to add this support here.
I wonder what module would theoretically provide the webp hook even once 2340699 lands. Maybe stage_file_proxy would which seems like it adds to the argument to add this support here for now.
@mherchel @markdorison are you vouching for this patch? Is it RTBC in your perspective?
Looking at the first comment:
> has been updated to work with the ImageAPI Optimize WebP module instead.
It seems like we should ideally support whatever are the most common and support several of them (i.e. both vs instead).
Comment #8
markdorison@greggles We have been using the #5 patch on one of our sites since September 2020 without issue, so from our perspective this is RTBC.
Comment #9
mherchelI haven't tested out the patch yet. Note that I'm currently using the regular Webp module.
I'll make a point to test this out in the coming days.
Comment #10
mherchelIt's not working for me.
Below are the errors that I'm seeing. What am I doing wrong?
Comment #11
mherchelComment #12
marcoscanoThe webp module converts image derivatives only, so the code that tries to grab the original image should be skipped if we are dealing with a webp image. Here's a simple check to skip it, which seems to make it work in my testing.
Comment #13
mherchelThanks @marcoscano!
Just tested this out and it works wonderfully!
Comment #14
markdorisonHoping to get this committed but I have one question:
Why are we calling
exit;in this case? Is that intentional?Comment #15
marcoscanoWe are not really changing it here, are we? The git diff makes it look more complex than it should, but this chunk is already part of the original code: https://git.drupalcode.org/project/stage_file_proxy/-/blob/8.x-1.x/src/E...
Comment #17
markdorison@marcoscano You are correct. Thanks for pointing that out!
Comment #19
afi13 commentedpatch #12 doesn't work for me, added a small fix
Comment #20
ericdsd commentedPatch #12 worked for me against 8.x-1.1
Patch# could not be applied.
Comment #21
gregglesI made https://www.drupal.org/project/stage_file_proxy/releases/8.x-1.2 that includes this code so folks don't have to mess with patch files on the stable release.
Patch #19 seems like it could be problematic since it looks for .webp anywhere in the string and is case sensitive (but I don't use webp a ton, so not sure).
Comment #22
mattjones86This doesn't work for me with
imageapi_optimize_webpenabled. This seems to be due to it skipping the download of original files in this block:This seems to be because the remote server hasn't yet generated it's image style from the original. I'm not sure why this isn't triggering the remote to generate it's imagecache, but either way it seems strange not to honour the
use_imagecache_rootsetting.Example:
Comment #23
froboyI had a similar problem as @mattjones86 and the patch in #19 resolved it for me. It's possible that should be reconsidered.
Comment #24
couloir007 commentedI'm using Drupal 9.3.14's built in webp image style and all my images are generated as "image_name.jpg.webp", or the equivalent, and I've tried the latest stable release and the dev release with this patch and I can't get it to work. I notice in the patch it was looking for a different pattern so I adjusted, but still couldn't get it work.
Thanks!
Comment #25
yonailo commentedI was experiencing infinite 302 redirection loops, my settings are "imagecache root" enabled / "hotlink" disabled.
Patch #19 solved the issue for me too.
Comment #26
heddn[#417107-21] is basically the same thing.
Comment #27
endrukk commentedPatch #19 working for me too Drupal 9.4.7 after
drush if --all@couloir007 have you tried flushing image cache
Comment #28
stijnhau commentedPatch failes to install with version 1.3 and 1.4
Comment #29
falco010In latest version 2.0.2 for Drupal 10, this patch/fix did not work properly anymore.
Hereby a rerolled patch which should apply to 2.0.2 and fix the issue.
Comment #31
eescribanoc commentedHereby a rerolled patch for the version 3.xSorry this patch doesn't work, I need to remake it unless I can use changes already done in the fork for this issue
Comment #33
eescribanoc commentedTrying again to add the patch for version 3.1.x
Comment #34
eescribanoc commentedOnce more, the patch failed on the #33
Comment #35
nginex commentedCreated a new issue for 3.1.x version with the patch that helps https://www.drupal.org/project/stage_file_proxy/issues/3529745