Image styles not working with encrypted Image file fields

Created on 31 December 2024, 5 months ago

I am encountering several issues trying to use the Thumbnail image style, from the Image module, on an encrypted image file field.

For one, the thumbnail is being created and is not encrypted. That seems like a problem.

For another, in the encrypted file directory, the encrypted original file is in the path specified in the field settings - eg YYYY-MM/filename.jpg - with no encryption profile name. The styled thumbnail image is inside a directory with the name of its encryption profile - eg styles/thumbnail/encrypt/test_profile/YYYY-MM/filename.jpg. The other modules that handle displaying styles images are making assumptions about the style path. Private files, for instance, are in styles/thumbnail/private/YYYY-MM/filename.jpg. The mismatch is causing it to fail, usually with a 404 Not Found error, sometimes with an Access Denied error.

Something else that I'm not sure is related is that the Image module expects something to be setting a header in a hook_file_download() implementation. The File Encrypt module isn't setting anything, nor are any of the other modules directly involved with encrypted files. I think this is why I am seeing Access Denied from the thumbnail images.

The full size unstyled image files work without issue, as far as I can tell so far.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States brad.bulger

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

Comments & Activities

Production build 0.71.5 2024