mmikkel / Retcon-Craft

A collection of powerful Twig filters for modifying HTML
MIT License
79 stars 9 forks source link

Issue of Default Size of Height in srcset function #65

Closed bharat303 closed 1 year ago

bharat303 commented 1 year ago

In commit : https://github.com/mmikkel/Retcon-Craft/commit/855699975e4e3c3c28858402e157d7bfd79a18be You have set default value of $height to 11 instead of 1 by mistake I think.

Current code is as following at line number around :

if ($base64src) {
    $node->setAttribute('src', RetconHelper::getBase64Pixel($width ?? 1, $height ?? 11));
}

Can you please set it to 1? This is creating serious issue for us as next content after inline image is loaded by animation, and due ratio of 1:11, it's showing blank as it's allocation huge pillar space due to 1:11

i.e. That should be like this by default values :
src="data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 1'/>"

Instead of :
src="data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 11'/>"
mmikkel commented 1 year ago

Thanks for reporting that! Fixed in Retcon v. 2.7.4.