Access Denied on WebP images with Image Optimize API

Created on 3 December 2020, over 3 years ago
Updated 23 November 2023, 7 months ago

Problem/Motivation

I had successfully used WebP (the previous release) in combination with Image Optimize API in a previous project, without issue. I tried the same today, and no image was rendered. I confirmed that my local environment has WebP support enabled, but no image is visible, and attempting to access the image directly shows an "Access Denied" message.

The error that appears in the log is:
Path: /sites/default/files/styles/[image_style]/public/images/[image_name].webp?h=51c99b7d&itok=aU2WBPed. Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException: in Drupal\webp\Controller\ImageStyleDownloadController->deliver() (line 161 of /Users/mandclu/Sites/echidnaville/docroot/modules/contrib/webp/src/Controller/ImageStyleDownloadController.php).

Steps to reproduce

Set up both WebP and ImageOptimize API, with the WebP processor included in the default pipeline. Visit a page that uses a derivative image and observe that the image is not visible, but shows the broken image icon instead.

πŸ› Bug report
Status

Fixed

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada mandclu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024