Reading metadata fields when importing images on card creation

Hello!

I noticed today when creating cards with images that Anki doesn’t read an exif metadata field that tells Windows (for example) the correct orientation of the image. So Windows would show me the image in the correct orientation but Anki would import it shifted 90 degrees.

I suspect that this shouldn’t be too hard to implement, so I would like to help if possible :slight_smile:

Can someone more knowledgeable in the codebase tell me where does the code that imports images is located?

Thanks!

The web toolkit Anki uses doesn’t currently support image rotation, but it should do in a future update.

Thanks for the reply! So there is no way for now to apply a rotation found on the metadata of an image on Anki’s side?

Anki just places the files in your media folder and relies on the webview to display them. You could potentially use third-party tools to rotate the images and strip out the rotation tags in the mean time.