Skip to content

fix: changing image filename exported to anki to use only lowercase - #707

Open
marcomachado wants to merge 1 commit into
LuteOrg:developfrom
marcomachado:bug-701-filename-anki-export
Open

fix: changing image filename exported to anki to use only lowercase#707
marcomachado wants to merge 1 commit into
LuteOrg:developfrom
marcomachado:bug-701-filename-anki-export

Conversation

@marcomachado

Copy link
Copy Markdown
Contributor

Closes #701

This PR changes the Anki export image filename prefix from uppercase LUTE_TERM_ to lowercase lute_term_ to ensure compatibility with newer versions of Anki.

  • Updated handle_image in lute/ankiexport/field_mapping.py to generate the image prefix in lowercase (lute_term_). Both the HTML reference and the stored filename parameter will now be sent to Anki in lowercase.
  • Updated unit and integration tests to verify the lowercase prefix and swapped payload execution order.

@jzohrab

jzohrab commented Jul 21, 2026 via email

Copy link
Copy Markdown
Collaborator

@marcomachado

marcomachado commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Yes! I think so, but, in fact, I didn't test it

Anki now defines a default way to saved images filenames instead of rely it to other applications (like Lute which decided to use upper case)

But old cards are already exported and configured using upper case, both in card (img src) and image file in filesystem

If a user uses an older version of anki and creates a new card: Anki will rely of Lute to define filename for images and a card will be generated using lowercase

@marcomachado

Copy link
Copy Markdown
Contributor Author

Tests:

For new files:

  • ideal scenario: LUTE (branch version) + Anki (current version) = LUTE will create cards already with lowercase; anki will save with lowercase (default)

Alternatives scenarios:

  • [BUG] LUTE (current version) + Anki (current version) = bug (LUTE will use uppercase; Anki now uses lowercase)
  • [OK] LUTE (current version) + Anki (old version) = Anki will rely on Lute to define filename, so files will be saved using uppercase
  • [OK] LUTE (branch version) + Anki (old version) = Anki will rely on Lute to define filename, so files will be saved using uppercase

For old files: Anki don't change already saved cards and files

@jzohrab jzohrab self-assigned this Jul 25, 2026
@jzohrab jzohrab added this to Lute-v3 Jul 25, 2026
@jzohrab jzohrab moved this to In Progress in Lute-v3 Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

[Bug] Image filename case mismatch in Anki export (AnkiConnect)

2 participants