Imager-Craft icon indicating copy to clipboard operation
Imager-Craft copied to clipboard

base64Pixel() conflict with Picturefill.js (IE11)

Open croxton opened this issue 8 years ago • 2 comments

The code generated by this causes picturefill.js to crash IE 11 (assuming you are using it to polyfill <picture> in older browsers that don't natively support it):

<img src="{{ craft.imager.base64Pixel(16, 9) }}">

Not really a bug but I thought I'd leave this note here in case anyone else runs into it and save them the hour I spent tracking it down.

croxton avatar Oct 26 '17 13:10 croxton

Thanks Mark. Have you tracked down the underlying cause? Is it the fact that it's a base64 encoded svg, or something with the escaping maybe?

aelvan avatar Oct 26 '17 13:10 aelvan

As far as I can tell base64 is fine so long as it's a gif, but that code generates an SVG and that's what is causing picturefill to choke. This works fine:

  <img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==">

croxton avatar Oct 26 '17 13:10 croxton