Repository navigation
Add support for no width and no height on images - #715
Conversation
|
Closes #714 |
|
The images are linked by relative paths because that's how it was before and I didn't know if I should change it. Should I embed them as base64 strings instead? |
|
Relative paths are fine. As for the code, I would suggest using |
Seems like this API is only available for |
|
Much better now.
Weird, ok. Also about the PR name. We do support optional width/height. We do not support aspect preserving. |
|
Also, I think we need tests with non-rectangular images. Otherwise the aspect is always 1:1 and we're not testing anything. No? |
It's not necessarily about the aspect. Before: If we have an image with size 100x100, but set only the height to 200, then the image would be assumed to be 100x200 -> It will get shifted instead. Now: If we have an image with size 100x100, but set only the height to 200, then the width will be increased by the same ratio that the height would increase/decrease, so in this case 200 -> the result is 200x200. |
Okay, will add it. |
|
Thanks! |
In case only one of the height/width attributes are set and we have a viewBox, we currently report an incorrect size: the height/width that is set and 100% of the viewbox's attribute for the other attribute. This is incorrect, and we should instead compute the missing attribute value from the specified one and the viewBox' aspect ratio, like was done by linebender#715. I have validated that this fixes servo's servo/servo#41273 Signed-off-by: Simon Martin <[email protected]>
In case only one of the height/width attributes are set and we have a viewBox, we currently report an incorrect size: the height/width that is set and 100% of the viewbox's attribute for the other attribute. This is incorrect, and we should instead compute the missing attribute value from the specified one and the viewBox' aspect ratio, like was done by linebender#715. I have validated that this fixes servo's servo/servo#41273 Signed-off-by: Simon Martin <[email protected]>

No description provided.