Skip to content

Read Krita's .kra~ backup files (#1077) - #1101

Merged
KnifeLemon merged 2 commits into
mainfrom
feat/kra-backup
Nov 4, 2026
Merged

KnifeLemon merged 2 commits into
mainfrom
feat/kra-backup

Conversation

@KnifeLemon

Copy link
Copy Markdown
Owner

What changed

Krita keeps the previous save as name.kra~: the same KRA file under another name. Filee now reads it as KRA, so it converts like .kra (PNG, JPG, WebP, PDF, …) and the output is named name.png.

  • kra~ is one more extension of the KRA entry in FormatRegistry, next to kra. Path.GetExtension("name.kra~") is .kra~, so detection, the images donut and the output name (NameWithoutExtension → name) all work without new code. This is the same thing the png_large / jpg_large aliases do.
  • Schema 65: the images donut of existing installs learns kra~; a user's own donut that already claims it keeps it. (Schema 65 may be renumbered if another change takes it first: the .dbml and FLIC PRs add one each, and feat(tools): Add background tool #1081 just took 64.)
  • Donut editor: an extension Filee knows is accepted as it is. Before, the ~ was refused, so the .kra~ the autocomplete offers couldn't be added back after removing it. Unknown text still has to be letters, digits and - _ + ..
  • Watch folders skip names ending in ~. Krita writes the backup next to the drawing on every save; converting it too would put the previous picture under the same name.png. Before this change .kra~ was simply unknown, so watch folders behave as they did.
  • docs/ENGINES.md: one line on the backup in the KRA paragraph.

Why not a general "trailing ~" fallback

A fallback in ExtensionOf/Detect that strips any trailing ~ would also make notes.txt~, report.docx~, config.ini~ (Emacs / gedit backups) convertible, change what ExtensionOf returns for every caller (donut matching, output names, watch folders, the format request), and would need its own rule for donut extensions. Only Krita's backup was asked for, and it is a byte-for-byte KRA, so one more extension is the narrowest correct change. If more ~ backups come up, the fallback can still be added then.

How it was tested

  • FormatRegistryTests: sketch.kra~ is detected as kra.
  • ImageExtensionAliasTests: .kra~ (any case) is KRA, named sketch, and opens the images donut together with .kra; notes.txt~ / sketch.kr~ are not detected; schema 64 → 65 learns kra~ once and leaves a custom claim alone.
  • OutputPathResolverTests: sketch.kra~ → sketch.png.
  • FolderWatcherTests: a watch folder ignores sketch.kra~.
  • ExtensionInputTests: *.KRA~ → kra~; txt~ is still refused.
  • KritaTests (engine): a generated sketch.kra~ converts to sketch.png from its merged picture.
  • dotnet build Filee.slnx; all of Filee.Core.Tests (977 passed, 3 skipped, incl. FormatFieldsTests); KritaTests (5); ExtensionInputTests + LocalizationTests (250); dotnet format Filee.slnx --verify-no-changes.
  • The whole Filee.App.Tests ran once before the rebase onto feat(tools): Add background tool #1081: 1826 passed, 6 skipped, 2 failed. MergeOrderTests passes on its own (a timing failure under load); RenderTests.Engines_page_shows_versions_descriptions_and_download_speed fails on this PC because a system Tesseract (C:\Program Files\Tesseract-OCR) reports no version; neither touches this change.

Closes #1077

🤖 Generated with Claude Code

KnifeLemon and others added 2 commits November 4, 2026 11:18
Krita keeps the previous save as "name.kra~", the same KRA file under another
name. The KRA entry now lists "kra~" as one of its extensions, like the
png_large / jpg_large aliases, so the backup is detected as KRA, opens the
images donut and converts to "name.png".

- Schema 65: the images donut learns "kra~"; custom claims stay put.
- The donut editor accepts extensions Filee knows as they are, so the
  suggested ".kra~" can be added (it refused the "~" before).
- Watch folders skip names ending in "~": Krita writes the backup next to
  the drawing on every save, and converting it too would put the previous
  picture under the same output name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1094 (DBML) took schema 65 first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KnifeLemon
KnifeLemon merged commit 8f846f4 into main Nov 4, 2026
21 of 22 checks passed
@KnifeLemon KnifeLemon mentioned this pull request Nov 4, 2026
1 task done
KnifeLemon added a commit that referenced this pull request Nov 4, 2026
#1094 (DBML) took 65 and #1101 (.kra~) took 66.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rohitLovesKrishna pushed a commit to rohitLovesKrishna/Filee that referenced this pull request Nov 4, 2026
The win-arm64 job hung at "Build Explorer menu extension" twice on 2026-11-04 (KnifeLemon#1090, KnifeLemon#1101) until the two-hour
limit, while the same step takes about two minutes. zig cc now gets eight minutes per try, three tries, each retry
with a cache of its own; the step itself stops after 30 minutes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KnifeLemon added a commit that referenced this pull request Nov 4, 2026
#1094 (DBML) took 65, #1101 (.kra~) 66 and #1099 (FLIC) 67.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

[Format]: .kra~

1 participant