- πΊπΈUnited States smustgrave
Tagging for CR update as a new api function
hook_image_style_source_alter
doesn't seem to be referencedAlso was previously tagged for IS update which may still need to happen
Did not test patch.
- π¬π§United Kingdom catch
I hadn't seen this yet, it looks like the same use-case as π Allow image style derivatives to use a separate stream wrapper Closed: duplicate except that would just allow the stream wrapper to be configured. π Make css/js optimized assets path configurable Fixed shows what it looks like.
- ππΊHungary djg_tram
Oh, dear me, a major showstopper and nothing has changed for years. :-( That hook would be desperately needed, up to the latest 10.1 and more... What could we do to make it happen ASAP?
- ππΊHungary djg_tram
For those who happen to be in my shoes: create a route subscriber and alter the route `image.style_private` to your own controller. Copy `Drupal\image\Controller\ImageStyleDownloadController\deliver()` to it and modify it to either do something entirely different, or probably just handle your own case and call `parent:.deliver()` to get the original behavior.
- last update
about 1 year ago Patch Failed to Apply - last update
about 1 year ago 29,676 pass - π¬π§United Kingdom fonant
@djg_tram - I can managed to get the derived image written to the public filesystem, but how do I tell Drupal to use the public URL for this image, rather than the private
/system/files/...
one? - π©πͺGermany a.dmitriiev
@fonant, if you use the patch and the hook, there is no need to do anything else. The uri of the image is changed for image style, so if it is public then the url will be for public scheme.
- π¬π§United Kingdom fonant
@a.dmitriiev thanks, I was wondering how @djg_tram had managed with his method.
I now have this working with the patch and a custom module with a hook. Needs a bit more work and some tidying before I post it here.
- πΊπΈUnited States SocialNicheGuru
Now that π Image derivative generation does not work if effect "Convert" in use and file stored in private filesystem Fixed patch in #101 no longer applies
- πΊπΈUnited States SocialNicheGuru
Rerolled 101 to apply to Drupal 10.2.x with the commit, π Image derivative generation does not work if effect "Convert" in use and file stored in private filesystem Fixed which causes the conflict.
- πΊπΈUnited States SocialNicheGuru
I am testing it.
the uri has changed.
but i can't seem to get the image_style with the new public uri to be generated.
Should I add code to the hook to generate the image styleDrush cr does not seem to be doing it
- π©πͺGermany a.dmitriiev
I have the patch and this hook in a custom module.
/** * Implements hook_image_style_uri_alter(). */ function MY_MODULE_image_style_uri_alter(&$uri, array $context) { $image_style_name = $context['image_style']->id(); if (in_array($image_style_name, ['watermarked', 'watermarked_other'])) { $path = $context['path']; // Low resolution, watermarked images are available in the public readable // stream wrapper. $uri = "public://styles/$image_style_name/public/$path"; } }