Skip to content

Repair broken SVG files created by the Image Occlusion 2.0 Anki addon

Notifications You must be signed in to change notification settings

mrestko/image-occlusion-svg-fix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

image-occlusion-svg-fix

Repair broken SVG files created by the Image Occlusion 2.0 Anki addon

The popular Anki addon Image Occlusion 2.0 has been creating SVG files with a broken style attribute. This was working fine until a recent Android update stopped honoring the broken tags. I submitted a patch to the Image Occlusion repo which fixes this problem for new cards. However, old cards still need to be fixed and that is the purpose of this utility.

Usage

The Anki media collections directory is a folder where Anki stores all of the images associated with your flashcards. By default, it is located at Documents/Anki/User 1/collection.media.

Method 1 (Windows only)

  1. Back up your Anki media collections directory by finding the folder and making a copy of it somewhere else on your computer. (Once you have completed all the steps and verfied that all of your cards are still working, you can delete this backup folder.)
  2. Copy the file fix_image_occlusion_cards.exe from the bin/ folder in the dowloaded zip file into your Anki media collections directory.
  3. Double-click fix_image_occlusion_cards.exe to fix your broken Image Occlusion cards
  4. Sync you Anki collection up to AnkiWeb and then down to your Android device

Method 2

(This method requires that you use the command line. I can't explain all the steps for using the command line here, but I've found command line "getting started" resources for: Windows and Mac OS X)

  1. Back up your Anki media collections directory by finding the folder and making a copy of it somewhere else on your computer. (Once you have completed all the steps and verfied that all of your cards are still working, you can delete this backup folder.)
  2. Your computer must have Python installed. This is installed by default on Mac OS X but on Windows you will need to go to https://www.python.org/downloads/ and follow the instructions to download and install Python 2.7.
  3. This script needs lxml which can be installed by running pip install -r requirements.txt
  4. Copy the file fix_image_occlusion_cards.py into your Anki media collections directory.
  5. Run the script at the command line with python fix_image_occlusion_cards.py
  6. Sync you Anki collection up to AnkiWeb and then down to your Android device

About

Repair broken SVG files created by the Image Occlusion 2.0 Anki addon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages