Skip to content

How to get raw SVG from code?  #19

@joemaller

Description

@joemaller

A project was upgraded to v3.0 but had been relying on the height/width of embedded SVGs embedded using <?= $SVG->arrow ?>. Because the updated library now normalizes the SVG and strips dimensions, there were a number of places where SVGs appeared too big or invisible because of a zero-dimension.

Can there be a way of accessing the original, unmodified file from code? Maybe go back to "raw" or "src" like this?

<?= $SVG->raw->arrow ?> or <?= $SVG->src->arrow ?>

Or, keeping the magic methods pure, an argument could be added to the embed method?

For the raw source content, do this: <?= $SVG->embed('arrow', false) ?> where the argument would be something like $cleanSVG or $normalizeSVG. Sending true to get the raw source contents seems to go against what the library is trying to do: <?= $SVG->embed('arrow', true) ?>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions