I don’t see any other post this problem, so I feel, maybe only I met that.
But I found a solution, so just share how to fix it.
Just add code below at the start of template(both front and back).
I tried that first because it’s the easiest way, and that just doesn’t work. It’s hard to determine the cause of problem, so using code is helpless move, and I had to.
Hope that it only happens to me.
On my system (OS Catalina Macbook Pro 2012 mid), while the image does appear after adding the above css, the occlusion boxes are misaligned on the image when previewed. The image also doesn’t resize to fit the deck UI.
AnkiDroid issue as well:
Interestingly, the image does appear and auto-resize when the card is viewed on Android. However, I get the following error: Error loading image occlusion. Is your Anki version up to date? ReferenceError: anki is not defined". Looking at the tempate, the error message is being triggered by the following:
<script>
try {
anki.imageOcclusion.setup();
} catch (exc) {
document.getElementById("err").innerHTML = `Error loading image occlusion. Is your Anki version up to date?<br><br>${exc}`;
}
</script>
You are right, the above CSS has an issue where the masks are misaligned if the image is vertically long.
The issue with the Qt5 version where the image occlusion cards do not show up in the reviewer or previewer has already been fixed in the latest development code. I would recommend using the Qt6 version until the next version is released. If you need to use the Qt5 version because of compatibility issues with add-ons, video driver issues, etc., try the workaround below.
Front and Back templates
Add the following to the beginning of the <script></script> block:
This workaround will conflict with Anki’s internal scripts in the next version, so be sure to revert to the default after updating to the next version.
I am unable to install the Qt6 version on my 2012 Macbook Pro (OS Catalina). Thanks for the quick fix! Your Javascript workaround works. I look forward to the next release.
I just tested a few IO cards with AnkiDroid 2.17alpha6 and they seem to display properly both with the default Image Occlusion notetype and the one with the modifications mentioned above.
Thanks for heads up on the AnkiDroid 2.17alpha6 version, which works, unlike the 2.16.5 version I had installed from the playstore. When do you think the desktop version, with the bug you fixed, will be released/built for download?