-
Notifications
You must be signed in to change notification settings - Fork 39
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
Follow up: Complement SVG image support in image library and elsewhere #6497
Comments
Here's a PR to consider viewBox as (additional) fallback. That seemed to be the easiest of the four tasks. Handy to test: our brand new iconset in core (/core/misc/icons), as none of them has width/height, but all of them have viewBox set. 😉 Edit: PR removed (as not planned) |
Interesting finding, why image_get_info doesn't work for newly uploaded svg files: The first check is to ask the image toolkit, if this is something usable - SVG is not, so there's a second check. That check, down the road, relies on the file extension. And what we have at that point of uploading is something like I belief, that's a bug. @docwilmot what do you think? Or was it @herbdool, who struggled with that? I guess, this is relevant for CKEditor, as it uses file_validate_is_image() as upload validator for drag-and-drop upload. |
Regarding |
@herbdool re viewBox: I absolutely understand, that you hesitate. Things look even more complicated, when switching to the official spec. We could postpone that viewBox parsing, until someone comes up with a request... Any opinion re the other three subtasks? |
Sounds like the ckeditor drag and drop is important enough to be it's own issue. I don't feel strongly about the others. I'm guessing pre existing SVG files aren't a big issue. If people were actively uploading bunches of them they were probably installing the svg_image module already. |
Description of the task
As of #5541 core now supports using SVG files as image. 🚀
Some details are still pending discussion and implementation. Im collecting here, what comes to my mind. It might be, that we split this into several issues. We'll see.
settings.php
or config)Do we want to provide such a setting, for example on
/admin/structure/file-types/settings
or some sort of hook?ConsiderviewBox
attribute as an additional option to determine dimensionsWe currently only rely on
width
/height
attributes in the main<svg>
tag in functionimage_get_svg_dimensions()
, butviewBox
is another (relatively easy to parse) option. That's the attribute browsers seem to use as a fallback to consider dimensions for rendering.Currently it's easy to select a previously uploaded svg in the editor, but drag-and-drop upload doesn't seem to work yet. Do we want to add that? Should we discuss that in a separate issue?
Or that they don't have dimensions set via
image_file_presave()
.Also if site is upgraded from Drupal - do we have to run an update hook? (It might work out of the box)
Additional information
The text was updated successfully, but these errors were encountered: