Notion2Anki: Removing Image Stretching in Anki
Fix image stretching from Notion2Anki using this one line of code!
![Notion2Anki: Removing Image Stretching in Anki](/content/images/size/w2000/2020/10/Notion2Anki_-_Anki.jpg)
Notion2Anki is amazing for converting Notion documents into Anki flashcards, but one of the problems I came across was that images were getting all stretched out of shape to Anki to the point where they became unreadable.
There's an elegant solution for this. I spent several hours creating a Python script, but it turned out to be completely unnecessary, the problem solved by simply adding a single paragraph of CSS to the Anki cards.
<style>
img {
object-fit: contain;
}
</style>
You need to add this to the card styling in Anki.
![](https://www.dabido.com.au/content/images/2020/10/image.png)
This fixes the image stretching problem that Notion2Anki introduces to your cards. A delightfully low effort solution!