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.

I was mistaken in the details there. The encrypted image file field automatically changes the File directory setting of the field to "the_encryption_profile_name/whatever-the-user-typed". The original file is encrypted and uploaded to "whatever-the-user-typed/filename.jpg" in the encrypted files directory - it is not prefixed by the encryption profile name, as the field setting would imply. The styled image file, however, does include the encryption profile name in its path - eg "styles/thumbnail/encrypt/the_encryption_profile_name/whatever-the-user-typed/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/whatever-the-user-typed/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.

Comments

brad.bulger created an issue. See original summary.

brad.bulger’s picture

Issue summary: View changes
dmundra’s picture

dmundra’s picture

I looked at this yesterday and I believe that it is correct, image styles are not working. I believe the logic to create an image styles requires it be able to process the image as unencrypted to generate an image style. I am thinking that this non-working feature should be removed or at least presenting a message that it does not work.