Hi!
I don't know if I should declare this issue as a Bug or a Feature request as it's somehow both to me.
I'm using Blazy Version 8.x-2.1 and the Svg Image Module to be able to upload svg images in the core image field and I'm also uploading SVGs as inline-images in CkEditor.
Using the blazy formatter in views to show for example some svg icons from an image field leads to an error message:
Unable to generate the derived image located at public://styles/image_style/public/path/to/svg/icon.svg
So Blazy tries to load an image style for svg images which won't work as the toolkit can't handle svg files.
But at least it generates some img tag output.
Using the blazy filter in my textformats results in no html output for the image at all if it is an svg image.
I tried to find out the source of this problem and I think it could be the isValid() check in fakeImageItem method of BlazyMedia class as the toolkit will return that svg is not a valid image format?
Without SVG support I can't really use this module.
SVG is an important image format to keep file sizes small, be responsive and sharp at all times and it will always be used somewhere on our websites.
So I hope this module will support svg images soon, so that it can help improving site performance.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3149843-support-svg-3.patch | 12.59 KB | gausarts |
Comments
Comment #2
gausarts commentedThank you.
It is a Feature, IMHO. Core has no SVG render element like table, fieldset, or HTML, etc. Only basic html_tag. A bug when core has it.
Feel free to patch if you or anyone are working on it. Features might be in when someone is working on it. That someone is not me by now :)
Comment #3
gausarts commentedInitial attempts.
This feature appears to be related to #3139111: Animated Gif support.
Actually Blazy already works with SVG as long a you don't fill out (Responsive) image style.
Attached is to simply bail out to avoid nasty errors.
Added an option to exclude certain extensions from having image styles applied, also relevant to the linked issue with animated GIF.
Also included the fix for Blur effect issue missing the blur image.
Comment #5
gausarts commentedFeel free to re-open if any misses.
Committed. Thank you for contribution.
Comment #6
gausarts commentedI just realize we can also convert SVG to other image formats using ImageMagick module.
Without it, core
Drupal\image\Plugin\ImageEffect\ConvertImageEffectalone will surely fail.Setting this active again to not hard code the SVG in the first place. The hard-coded SVG support was in since #3027848: Wrong output dimensions for non-responsive SVG images .
As I have never used SVG, I didn't care much till this patch.
Potential solution while keeping BC is to remove the hard-coded SVG exclusion, provide a
hook_updateto make it default, yet removable, to not break old existing assumptions.Patches are welcome, in case I am slower.
Off-topic:
In case I forgot anything during the move, I am keeping a reminder to myself here: http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=svg
Comment #7
gausarts commentedPostponed till we need this feature. Feel free to re-open if anyone is working on it.
Comment #8
gausarts commentedA friendly housekeeping before a new release.
This has passed 1 year, and no contribution on this regard, unfortunately.
We should close this to avoid false expectations.
However contributions are always open and very much welcome.
Feel free to re-open. Thanks.