V8-archive: S3 storage generates both local and s3 thumbnail + uses the local thumbnail to display

Created on 18 Jul 2019  路  2Comments  路  Source: directus/v8-archive

Bug Report

Steps to Reproduce

  1. git clone https://github.com/directus/api . and setup scheme based on src/scheme.sql
  2. composer install
  3. Copi version of api.php and setup to s3 upload
  4. Upload image either from a created collection with file field or from File Library
  5. Check that image + thumbnails is uploaded on S3 to verify the setup

Expected Behavior

Image and thumbnail is uploaded to Amazon S3 and directus use S3 source to display both the thumbnail and the full image. Furthermore it should not generate a local thumbnail.

Actual Behavior

Image and thumbnail are uploaded to amazon S3 _(Which is correct)_ at path:
Original image: https://<bucket>.s3.<zone>.amazonaws.com/directus/storage/uploads/<generated_file_name>.<file_type>
Thumbnail: https://<bucket>.s3.<zone>.amazonaws.com/directus/storage/uploads/thumbnails/200/200/crop/good/<original_file_name>.<file_type>

Directus do also create a thumbnail locally (If possible) at path:
https:///thumbnail/_/200/200/crop/good/.
If i am right this should not happen when storage is set to S3, and you now have the thumbnails two places.

Furthermore it is the local thumbnail which is used to display the image, which gives a blank image on for example Google App Engine where local storage is not possible
image

When opening the file at path /files/ the full image is displayed correctly from the S3 source

Other Context & Screenshots

Technical Details

  • Device: Desktop
  • OS: MacOS + Google App Engine
  • Web Server: Apache 2.4.37
  • PHP Version: 7.2.0
  • Database: MySQL 8.0.12
  • Install Method: cloned master branch
  • Use the master branch for both the app and the api
bug

Most helpful comment

Hey @jbitsch,,

Directus do also create a thumbnail locally (If possible) at path:
https:///thumbnail/_/200/200/crop/good/.
If i am right this should not happen when storage is set to S3, and you now have the thumbnails two places.

I tried to replicate this but not able to do so. If the adapter is s3 then the thumb will generate in s3; not in the local machine.

Although the URL for the thumbnail is always like https://<directus_app_url>/thumbnail/_/200/200/crop/good/<original_file_name>

And it is correct. As it is not containing the path of a thumbnail but it pointing out a PHP file. We have PHP file named thumbnail which will check the current adapter of your system and generate thumbnail over there as well as return too.

Hence the thumbnail URL does not depend on your adapter.

Please confirm so I can close this issue.

All 2 comments

Hey @jbitsch,,

Directus do also create a thumbnail locally (If possible) at path:
https:///thumbnail/_/200/200/crop/good/.
If i am right this should not happen when storage is set to S3, and you now have the thumbnails two places.

I tried to replicate this but not able to do so. If the adapter is s3 then the thumb will generate in s3; not in the local machine.

Although the URL for the thumbnail is always like https://<directus_app_url>/thumbnail/_/200/200/crop/good/<original_file_name>

And it is correct. As it is not containing the path of a thumbnail but it pointing out a PHP file. We have PHP file named thumbnail which will check the current adapter of your system and generate thumbnail over there as well as return too.

Hence the thumbnail URL does not depend on your adapter.

Please confirm so I can close this issue.

It's not an issue so closing this. Feel free to reopen it if you have any query.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gitlabisbetterthangithub picture gitlabisbetterthangithub  路  3Comments

Varulv1997 picture Varulv1997  路  3Comments

binary-koan picture binary-koan  路  3Comments

HashemKhalifa picture HashemKhalifa  路  3Comments

cdwmhcc picture cdwmhcc  路  3Comments