Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@abdnh
Copy link
Collaborator

@abdnh abdnh commented Sep 4, 2025

This sets the decoding property for img elements to async to avoid blocking rendering of card content while images are being loaded, which is a common issue with notes with a lot of images or high resolutions. I found setting this noticeably reduces lag.

@dae
Copy link
Member

dae commented Sep 17, 2025

Interestingly, there are some reports that it can actually slow down the loading of large images:

vercel/next.js#50524

No personal experience with this, and no strong feelings. If you'd like to merge this so we can get feedback from beta testers, please feel free.

@abdnh abdnh merged commit 75d9026 into ankitects:main Sep 17, 2025
1 check passed
@abdnh abdnh deleted the img-async branch September 17, 2025 06:06
@dae
Copy link
Member

dae commented Sep 17, 2025

Sigh - I'd planned to update the custom color PR to use the collection prior to building the release, but managed to forget about it, so I'll need to build .2 now. Just wanted to check your intentions here: I presume you wanted this to be merged after the patch release, not before it?

@abdnh
Copy link
Collaborator Author

abdnh commented Sep 17, 2025

I presume you wanted this to be merged after the patch release, not before it?

Oh, I didn't notice you made a release actually. I wanted to merge it before that.

@dae
Copy link
Member

dae commented Sep 17, 2025

Ok 👍

@jcznk
Copy link
Contributor

jcznk commented Sep 17, 2025

It seems to perform slightly worse on my computer (Windows 11) when there are multiple images:

Anki 25.09rc1:

25.09rc1.mp4

Anki 25.09.2:

25.09.2.mp4

@abdnh
Copy link
Collaborator Author

abdnh commented Sep 17, 2025

@jcznk Did you notice any rendering speed improvements as you flip through cards with images?

@jcznk
Copy link
Contributor

jcznk commented Sep 17, 2025

@abdnh Yes, the cards do seem to load a bit faster, especially when they contain large pictures. But the images themselves often lag, and the overall effect is somewhat "flickery".

AmandaSternberg-creator pushed a commit to AmandaSternberg-creator/anki that referenced this pull request Sep 25, 2025
@Chilaiditi
Copy link

Hello, I think this change is causing massive image flickering on cards that utilize CT/MRI scrolling.

@dae
Copy link
Member

dae commented Oct 1, 2025

I've created #4373

@caleblee789
Copy link

I have noticed that images tend to load slower on cards that have a large number of images, but faster when there are only 1 or 2 images.

@docdd6
Copy link

docdd6 commented Oct 21, 2025

This sets the decoding property for img elements to async to avoid blocking rendering of card content while images are being loaded, which is a common issue with notes with a lot of images or high resolutions. I found setting this noticeably reduces lag.

The images take too much time to load now on the new version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants