Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images get stored to cloudinary as "Raw" instead of "Image" when uploading via Directus #22687

Closed
DonCastillo opened this issue Jun 6, 2024 · 2 comments · Fixed by #22744
Closed
Assignees
Labels

Comments

@DonCastillo
Copy link

Describe the Bug

I have no problem uploading an image directly to Cloudinary, but when I upload via Directus (using Cloudinary as media storage), some images, particularly the image I attached with this bug report, they get stored to Cloudinary as "Raw" instead of "Image"

Here is the image:
testxxx

when I upload directly to Cloudinary (by dragging and dropping the file), the image gets stored as "IMAGE"
original filename is used, "testxxx.JPG"
image

when I upload to Cloudinary via Directus, the image gets stored as "RAW"
original filename used, testxxx.JPG; directus renamed it as f532f750-f696-4bc8-8702-e48954896b2e.JPG
image

To Reproduce

  • Spin up a local instance of docker-based Directus
  • Integrate Cloudinary with the following .env variables:

STORAGE_CLOUDINARY_DRIVER="cloudinary"
STORAGE_CLOUDINARY_ROOT="/testing"
STORAGE_CLOUDINARY_HEALTHCHECK_THRESHOLD=750
STORAGE_CLOUDINARY_CLOUD_NAME="...."
STORAGE_CLOUDINARY_API_KEY="...."
STORAGE_CLOUDINARY_API_SECRET="...."
STORAGE_CLOUDINARY_ACCESS_MODE="public"
FILES_MAX_UPLOAD_SIZE="100mb"
FILES_MIME_TYPE_ALLOW_LIST="/"

  • Other services used:
    mysql:5.7.8
    redis:6
    directus:10.12.0

Directus Version

v.10.12.0

Hosting Strategy

Self-Hosted (Docker Image)

Database

mysql:5.7.8

@DonCastillo DonCastillo changed the title Images get stored to cloudinary as "Raw" instead of "JPG" when uploading via Directus Images get stored to cloudinary as "Raw" instead of "Image" when uploading via Directus Jun 6, 2024
@turbolaserhawk
Copy link
Sponsor

Same issue.

Cloudinary has confirmed that Directus is uploading some images using type "raw" rather than image and it results in the asset being treated as a binary file and therefore not displayable. I think the issue is related to capitalization of "JPG" in file extensions rather than "jpg" or "jpeg".

image

@hanneskuettner
Copy link
Member

hanneskuettner commented Jun 13, 2024

Good find on the extension casing! Looks like we indeed only compare the extension in it's original case against a list of lowercase, known image extensions. I've created a PR, if you have the possibility to test it for me, I'd be super grateful, as I don't have a cloudinary account flying around at the moment.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants