We needed functionality similar to what this module provides on a Drupal 7 site. Much to my surprise, I could not find any such module for Drupal 7 that provides SVG functionality with the normal Image fields.
Although you may or may not be interested in maintaining a D7 version, I thought I would share the module we wrote for a client and leave it to you if you'd like to allow a D7 version in the repository.
This module only provides the basic functionality of allowing SVG uploads, and making them work (or at least not break) image styles. It does not include the special formatter settings for setting manual dimensions or using an <svg> tag.
Due to the massive differences between D7 and D8, there is pretty much no overlap in code. Given the level of differences I didn't try too hard to make them line up in any way, since these two versions are likely to maintained entirely independently.
| Comment | File | Size | Author |
|---|---|---|---|
| svg_image-d7.zip | 3.5 KB | quicksketch |
Comments
Comment #2
quicksketchComment #3
imyaro commentedComment #4
imyaro commentedHello,
I have published your version of module, but I didn't see many things (Requirement to the SimpleXML, custom image widget, validation and many other things)
Let's do it before the first stable release of the 7.x version.
Thank you
Comment #6
quicksketchHey great, thanks @zvse! Yes, it's pretty bare-bones. It only allows the SVG uploading and makes a rough attempt at working with Image Styles (it does not support rasterizing SVGs or effects like desaturate). Though it does work without any additional PHP extensions. However the premise is the same, so I'm thrilled that you've included it in this project so that it can have a home for D7 sites that need a similar feature. Thanks!