Bug: Exporting to ORA produces blank file

Issue

  • Moving a selected grouped area breaks ORA exporting.

Enviroment

  • OS: Linux
  • Arch: x86_64
  • Krita Version: 4.2.9-6

Steps to reproduce

  • Group several layers
  • Select rectangular area
  • Select the group layer
  • Use transform tool to move selection (all grouped layers) somewhere else
  • Export as ORA

Details

  • Saving it as KRA format produces the right file, even after re-loading this file, exporting it to ORA will produce a wrong blank file.
  • It’s always reproducible.
  • I suspect the ORA format exporter is trying to use the image offset extension wrong as the resulting file has strange x and y offsets together with blank pngs.

Workaround

  • Inserting a new layer then merging down the offending layer, effectively re-creating it, allows the exporter to produce the right ORA file.

Relevan files

Input.kra
Output.ora

I hope it’s the right place for a reproducible bug report.

Hello and welcome to the forum :slight_smile:

The right place for a formal reproducible bug report is here:
https://bugs.kde.org/ (it takes a bit of getting used to)

I can’t reproduce the bug as you describe it on the 4.2.9 appimage from the krita download site.

When I make any change to your Input.kra file and then try to close it, I get the message “The document ‘/tmp/bob.ora (Copy)’ has been modified Do you want to save it”

I’ve no idea why that is.

Can you try the 4.3.0 beta-2 appimage from here?:
https://krita.org/en/item/second-beta-for-krita-4-3-0-released/
Scroll down to near the bottom to get the Linux appimage.

Tested against Krita 4.3.0-beta2 AppImage and it reproduces exactly as reported.
You merely need to open the file then export as ORA format. If you close Krita then open it again then open the resulting ORA file, it’s blank. If you inspect the ORA file with a zip archiver, the layers are all blank, the stack.xml offsets are messed up.

I agree that the Input.kra file, when opened and Exported as .ora, results in an ORA file that’s blank. That does indicate there is something wrong with the Input.kra file.

Starting from nothing in a new document and making layers with content and following the Steps To Reproduce that you noted does not show any problem for me with the standard 4.2.9 appimage on Debian 10.
This is the puzzle.

You say you’re using krita 4.2.9-6. Is this from the Arch repository?

Can you reproduce this starting from a new document, using the standard appimage, either 4.2.9 or (preferably) the 4.3.0 beta-2?

If so, then please make a formal bug report.

Alright, I managed to reproduce it with only a single layer. I made a video about it.

Steps to reproduce:

  • Open input.ora
  • Move the Tiger
  • Export to Output.ora
  • Load Output.ora (is blank)

Video

The strangeness level is increasing.

You’ve provided an .ora file that does show a problem if you operate on it as you describe.
Its stack.xml file has x,y offsets in it and also references to MyPaint:
xmlns:mypaint=“http://mypaint.org/ns/openraster
mypaint:background-tile=“data/background-tile.png”

Starting from a new document, I’m unable to replicate this situation with a .kra file that has content and structure as you’ve described and shown, then moving content as you described and Exporting to an .ora file.

Can you provide a download link to the original .kra file that has the tiger picture in it?

Here is a kra file: input_from_new.kra

Steps to create it were:

  • Make canvas
  • Drag and drop layer from Drawpile or MyPaint to Krita, this seems very important, unable to reproduce with just copy paste.
  • Save

The other way to reproduce it is to just open a premade ORA file, no matter the contents. The resulting KRA file will be tainted with bad offsets.

Reproduces the same.

-edit, they just blocked my domain from sharing images? I can’t share images anymore and my thread is all hidden. Huuuhh???

I can still download files from all the links you posted and watch that video so I don’t know what may be happening for you there.

Yes, with input_from_new.kra, a simple move transform then export to .ora gives a blank image when you open that .ora file.

Inside the .ora file itself, the merged image is correct but the layer data image is empty white and empty transparent and the stack.xml file has an offset.
The input_from_new.kra file has that same offset in its maindoc.xml file.

These offsets do not exist when you create a .kra file from scratch or by using copy/paste on image content in krita taken from the images that do have offset source files.

It sounds like some mismatch or incompatibilty between krita and other applications when it comes to dealing with .ora files.

I’ve added a comment to your bug report at:
https://bugs.kde.org/show_bug.cgi?id=423088

I managed to reproduce it with pure Krita.
Steps:

  • Create new image
  • Scribble
  • Crop to selection
  • Resize canvas to a bigger area, you don’t even need to use transform tool, just stick to a corner. If you use the transform tool, it’s even more noticeable.
  • Export to ORA. (broken offsets)

Video

The spam filter got triggered because you had multiple links to your domain. Don’t worry you are not silenced or suspended.If you have any problem posting or replying here ping me.

The position stuff is something that is really vague in the spec right now so different applications handle it different… It might be fixed in 4.3? I recall @InkLab looking at something there…

I’ve just tried it with the 4.3.0 appimage
There’s an indication that it’s a layer size problem in the .ora file as well as any offset errors that may be there.

.kra file after Trim to Selection then Image Resize and dragged to a corner, Saved and reopened:

.ora file Exported from that .kra file:

I’m sure it’ll be fixed eventually :slight_smile:

well, if there’s a bugreport, yes it’ll be fixed eventually :smiley:

I will look into this too! It might have something to do with the small change that was implemented back here: https://invent.kde.org/graphics/krita/-/merge_requests/211/diffs?commit_id=7192a089a60ddce3070bad04f035264891460d68

What I am not sure is if this is a regression, or had generally been tested before that. It was my first pull request, so admittedly I might not know as much about the requirements of parts of the krita codebase as some others here.

It doesn’t happen with the 4.2.8 appimage but it does happen with the 4.2.9 appimage.

I made a tentative little patch at https://invent.kde.org/graphics/krita/-/merge_requests/386 , if anyone would like to give it a go with more complicated files than the ones in this thread. ;3

I can confirm that the above patch works for my cases.
I tested…

  • Drawpile generated ORA file, saving with transformations.
  • New KRA file, cropping and resizing canvas then saving to ORA
  • Dragging a ORA layer onto Krita and saving as ORA.
2 Likes