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

Let profiles control uploadable image extensions? #32

Closed
indigoxela opened this issue Nov 4, 2023 · 2 comments
Closed

Let profiles control uploadable image extensions? #32

indigoxela opened this issue Nov 4, 2023 · 2 comments

Comments

@indigoxela
Copy link
Member

indigoxela commented Nov 4, 2023

This just came to my mind while testing for a core issue. 😉

Currently extensions allowed for drag-n-drop/paste upload are based on image_gd_supported_extensions(), but actually that should rather be a fallback for images_file_types setting.

Mostly, because SVG isn't supported otherwise, but the editor actually handles it well.

@indigoxela indigoxela changed the title Let profiles control image extensions Let profiles control uploadable image extensions Nov 4, 2023
@indigoxela
Copy link
Member Author

Interesting... TinyMCE plays nicely when pasting svg. 😃

The server-side part is slightly trickier, though. Also, keep an eye on backdrop/backdrop-issues#5541 re SVG support in core.

A PoC is available. But I didn't decide, yet, if this is a valid approach (extensions via profile).
Actually, those extensions should be configurable via UI, but the Filter module doesn't provide that (but hook_form_alter might be an option).

Adventurous testers can play with it, but:

  • You have to apply the patch
  • You have to manually edit your tiny profile JSON and add "images_file_types": "jpg,svg,png,webp" inside tiny_options
  • Only drag-and-drop or paste uploads will work for SVG images

@indigoxela indigoxela changed the title Let profiles control uploadable image extensions Let profiles control uploadable image extensions? Nov 10, 2023
@indigoxela
Copy link
Member Author

I guess, after months of silence it's OK to close this issue with "lack of interest". 😉

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