Closed (fixed)
Project:
AMP Theme
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
15 Apr 2016 at 23:14 UTC
Updated:
30 Apr 2016 at 15:44 UTC
Jump to comment: Most recent
#2706663: Use amp-img for site branding logo properly uses amp-img for the logo in the branding block. However if the logo is an SVG, the height and width are empty because Drupal's image library cannot obtain that info from an SVG. We may be able to manually parse the SVG file to get the height and width from the ViewBox.
Note that the width and height attributes on an SVG are not terribly reliable since they can contain units, so are more difficult to parse. Checking the width and height of the ViewBox may not support all SVGs, but it supports more than now.
Comments
Comment #2
rainbowarrayTried this code both with and without an SVG for the logo. Seems to work fairly well.
Comment #4
rainbowarray