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

Add support for SVG upload via drag-and-drop #94

Closed
indigoxela opened this issue Apr 18, 2024 · 2 comments · Fixed by #95
Closed

Add support for SVG upload via drag-and-drop #94

indigoxela opened this issue Apr 18, 2024 · 2 comments · Fixed by #95

Comments

@indigoxela
Copy link
Member

indigoxela commented Apr 18, 2024

The first time this topic has been considered was in #32, but then postponed.

However, with latest movement in core issues, SVG becomes a topic again. Eventually for Backdrop release 1.28, we'll see.

Tiny handles svg as image pretty well, inline svg (as markup) aren't relevant here.
But there's some issue with drag-and-drop upload (current validator won't pass) and a similar problem with the images_file_types option passed to Tiny via js settings. (Not sure if it's a good idea to add svg to images_file_types - for all installs, but based on an admin setting for file upload (globally) it seems... OK.)

@indigoxela indigoxela changed the title Add support for SVG as img tag Add support for SVG as images in content Apr 18, 2024
@indigoxela indigoxela changed the title Add support for SVG as images in content Add support for SVG upload via drag-and-drop Apr 18, 2024
@indigoxela
Copy link
Member Author

indigoxela commented May 1, 2024

Yay, change is in core! 🎉

If image_get_info() worked with svg, there wouldn't be anything to do here. It doesn't.
It's probably better to replace file_validate_is_image with file_validate_extensions. But wait, solely relying on file extension seems like a bad idea.

@indigoxela
Copy link
Member Author

After some forward and back I decided to create a custom replacement for the file_validate_is_image check, so I don't have to wait for core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant