Extraction SVG dimensions from uploaded file. N database changes and fully Tailor compatible.
OctoberCMS automatically gets dimensions for raster images (JPG, PNG, GIF, WebP). However, SVG images do not store width/height in the database. This plugin provides runtime helpers to extract SVG dimensions directly from the file using
- width and height attributes from SVG files
- viewBox when width/height are missing
Installation via Command Line
php artisan plugin:install Depcore.SvgDimensions
The plugin provides a twig helper function to fetch dimensions and returns an array
{% set dims = svg_dimensions(record.icon) %}
{% if dims %}
{{ dims.width }} × {{ dims.height }}
{% endif %}
-
This plugin has not been reviewed yet.
-
| 1.0.1 |
First version of Svg Dimensions Jan 18, 2026 |
|---|