Bug 514760 - kra file is imported with its layer stack reversed
Summary: kra file is imported with its layer stack reversed
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: * Unknown (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2026-01-17 20:18 UTC by codl
Modified: 2026-04-07 12:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description codl 2026-01-17 20:18:41 UTC
SUMMARY
When importing a kra file into a document, the layers from the imported file end up stacked in reverse order.

STEPS TO REPRODUCE
1. Create or find a kra file with at least two layers.
2. Open a new document.
3. Import the file into the new document, either by dragging it onto the canvas and choosing "Insert as new layer", or with the menu entry Layer > Import/Export > Import layer.

OBSERVED RESULT
Layers are imported "upside-down": the topmost layer ends up on the bottom and so on.

EXPECTED RESULT
Layers end up in the same order as in the source file.

SOFTWARE/OS VERSIONS
Krita

 Version: 5.2.14 (git 31056c6)
 Hidpi: true

Qt

  Version (compiled): 5.15.7
  Version (loaded): 5.15.7

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 6.18.3-arch1-1
  Pretty Productname: Steam Runtime 2 (soldier)
  Product Type: steamrt
  Product Version: 2
  Desktop: XFCE
  Appimage build: Yes

ADDITIONAL INFORMATION
In my case I don't need separate layers from the imported file but rather a single flattened layer so my workaround is to add the file as a file layer and then convert it to a paint layer.

I'm running the steam build of krita but I've also tried krita plus 5.2.15-prealpha-c82e28995d with the same result. Couldn't try krita next, it wouldn't launch for me.
Comment 1 dra.w.p.il.e+bugskde 2026-01-17 20:24:56 UTC
Thanks, can confirm this also happens with other layered formats like ORA or PSD.
Comment 2 Dmitry Kazakov 2026-04-07 12:10:35 UTC
Git commit c7409cf349e9f2e66f4014e729b3ca9f7ed66d1f by Dmitry Kazakov.
Committed on 07/04/2026 at 12:10.
Pushed by dkazakov into branch 'master'.

Fix reversal of the layers when importing .kra as layers

The patch also disables the renaming of the "Background" layer
when the image contains multiple layers.

M  +10   -2    libs/ui/kis_import_catcher.cc

https://invent.kde.org/graphics/krita/-/commit/c7409cf349e9f2e66f4014e729b3ca9f7ed66d1f
Comment 3 Dmitry Kazakov 2026-04-07 12:10:46 UTC
Git commit 81b9d4682cd490ef21365dc4b1a18ffc17b36bdc by Dmitry Kazakov.
Committed on 07/04/2026 at 12:10.
Pushed by dkazakov into branch 'krita/6.0'.

Fix reversal of the layers when importing .kra as layers

The patch also disables the renaming of the "Background" layer
when the image contains multiple layers.

M  +10   -2    libs/ui/kis_import_catcher.cc

https://invent.kde.org/graphics/krita/-/commit/81b9d4682cd490ef21365dc4b1a18ffc17b36bdc