Doesn't work with S3FS

Created on 30 June 2022, almost 2 years ago
Updated 25 September 2023, 9 months ago

Problem/Motivation

When using S3FS and storing all public files on S3, the image styles aren't generated

Steps to reproduce

Enable S3FS and configure it to send all public files to S3
Visit a page that uses image styles - files won't load and an error such as "File 'JPEG:/tmp/imagick_DMaj11' could not be copied because it does not exist." is logged.

Looks like a fix was attempted 5 years ago in https://www.drupal.org/project/imagick/issues/2857497 - but the commit mentioned in that issue doesn't match the patch supplied - the code that prefixes the temp path with the image format always happens where as the patch removed it...

Attaching a patch that only adds the image format if the original destination is not a remote uri...

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom mjpa

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.

  • 🇫🇮Finland vermario

    Hi! The patch in #2 works but it might create a fatal error in the cases where the file is not present.

    This for us happens for example when working locally with a database exported from production, but without having the files.

    This updated patch adds a try/catch to prevent the fatal error.

    The idea is taken from another patch in the related issue https://www.drupal.org/project/imagick/issues/3018081#comment-14021982 🐛 Using a remote file scheme does not work Needs review

  • Status changed to Needs review over 1 year ago
  • Status changed to RTBC over 1 year ago
  • 🇪🇸Spain albertosilva Basque Country
  • Status changed to Needs review 9 months ago
  • 🇫🇷France GuillaumeDuveau Toulouse

    Here is an updated patch based on patch in #5 and fixing a PHP warning.

Production build 0.69.0 2024