tomusborne / generateblocks

GenerateBlocks is a small collection of lightweight WordPress blocks that can accomplish nearly anything.
https://generateblocks.com
194 stars 20 forks source link

When setting image width/height via non-px units, it does not pull the correct image in terms of size #1166

Open ScarlettYing opened 9 months ago

ScarlettYing commented 9 months ago

Description

When setting image width/height via non-px units, it does not pull the correct image in terms of size

Steps to reproduce

  1. add an image, activate the dynamic data.
  2. set image width and height to 3rem or any non-px unit.
  3. it adds height="3" and width="3" to the image HTML which pulls very small image.

Expected behavior

It calculates the width/heigth and convert it to px, and add correct width/height values in the image's HTML.

Actual behavior

It does not calculate, simply adds height="3" and width="3, which makes the image blurry.

References:

https://generate.support/topic/rem-units-bug-when-used-for-images/