I apologize if this has been asked before. I didn’t pull up any related stuff on my searching through the discourse forum here
width attribute prevents the image from maintaining its aspect ratio when it gets shrunk. In particular, the skew happens when the
width is set to a value greater than the width it would have in the shrunk state.
I know the attribute gets added when you use Anki’s native image resizing feature, but I’d just batch-remove that attribute and handle image sizes with the card template.
Yes, it’s possible to prevent the skewing in Anki.
We could for example apply
width/height: unset to the greater dimension of a constrained image. I’ll prepare a PR in the evening.
You’re incredible. I hope you know that
I’m unable to reproduce this. See below. Could you have an addon installed that’s affecting the display?
You’re right. It looks like the culprit is the Closet add-on
While its true that Closet injects CSS that can affect image sizes, the issue is easily reproducible with add-ons disabled.
Just take a picture with a vertical aspect ratio and set the width attribute to some high value. It will be skewed:
Closet was definitely affecting mine with the resize for what it’s worth but your explanation makes sense. Perhaps your solution will fix the closet interaction as well
I was wondering why it was working for me and not for kleinerpirat. Apparently this problem affects JPEGs but not PNGs. Maybe it’s a problem in Qt’s web engine?
Probably more related to their size. Did you try reproduce this with 2.1.63?
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.