This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Could not read pixel data

Tags: None
(comma "," separated)
Elle Stone
Registered Member
Posts
43
Karma
1
OS

Could not read pixel data

Thu Jul 09, 2015 4:51 pm
I tried to reopen a saved ".kra" file. The following message was displayed:
Code: Select all
Could not open /home/elle/edit/2process/2paint/painted-flower.kra
Reason: Could not read pixel data: blurred-leaves/layers/layer4.
Can this file be recovered? Any idea what the problem might be?

This is with Krita 2.9.5, git b23d328, running on Gentoo Linux.
User avatar
TheraHedwig
KDE Developer
Posts
1794
Karma
10
OS

Re: Could not read pixel data

Thu Jul 09, 2015 5:24 pm
Krita files are zip files, so try unzipping and maybe remove layer 4 to recover the other layers?

No idea what is wrong with it, or why it got corrupted though...
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Could not read pixel data

Thu Jul 09, 2015 5:40 pm
I'd also like to see the original, broken file to see what's up.
Elle Stone
Registered Member
Posts
43
Karma
1
OS

Re: Could not read pixel data

Thu Jul 09, 2015 7:16 pm
Upon unzipping:
Code: Select all
Extracting  blurred-leaves/layers/layer4     CRC Failed
Extracting  blurred-leaves/layers/layer4.defaultpixel
Extracting  blurred-leaves/layers/layer4.icc
The entire ".kra" file is 126MB. If necessary, I can try uploading the whole ".kra" file. Unfortunately my internet upload speed is slow enough that uploading the whole file would probably take hours. Would uploading just the "layer4" layers be sufficient? The "layer4" file with the actual image information is about 16MB.

Unzipping, removing the three "layer4" layers, and also modifying "maindoc.xml" to not refer to layer4, then rezipping did recover the entire file, except of course for layer 4. Fortunately layer 4 will be easy enough to recreate - the other layers would have taken a lot more work.

Possibly related: I encountered a similar error message about not being able to read pixel data, after opening a large tif created by GIMP, then saving the file as a ".kra" file. Krita could open the tiff (even 32f -yeah!) and save it as a ".kra" file, but couldn't reopen it. I tried to recreate the problem with a small tiff, but that didn't cause any problems. I had assumed that the problem was "operator error" and that somehow I'd managed to save a tif with the ".kra" extension. Now I'm not so sure.

Could either of these two file opening errors be related to https://bugs.kde.org/show_bug.cgi?id=345217 ?
Elle Stone
Registered Member
Posts
43
Karma
1
OS

Re: Could not read pixel data

Thu Jul 09, 2015 9:25 pm
I'd also like to see the original, broken file to see what's up.
If necessary, I can try uploading the whole ".kra" file.

Hi Boudewijn, I did upload the file. I sent you the link in an email.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Could not read pixel data

Fri Jul 10, 2015 11:07 am
Thanks. It's interesting because the file really _is_ corrupted, on the zip level. Either something went wrong when writing out the file (we didn't do enough checking when writing, I fixed that this morning), or the file got corrupted on the hard disk. As Wolthera said, unzipping, editing maindoc.xml to remove the reference to layer4 and then zipping up again is the only possible remedy.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Could not read pixel data

Fri Jul 10, 2015 4:14 pm
Hah, it was a different problem after all. The tiff file contained a Document entry which we take for the layer name; the name started with a /, which means the lpading code got really confused. Fixed in git.
Elle Stone
Registered Member
Posts
43
Karma
1
OS

Re: Could not read pixel data

Fri Jul 10, 2015 6:25 pm
Possibly related: I encountered a similar error message about not being able to read pixel data, after opening a large tif created by GIMP, then saving the file as a ".kra" file. Krita could open the tiff (even 32f -yeah!) and save it as a ".kra" file, but couldn't reopen it. I tried to recreate the problem with a small tiff, but that didn't cause any problems. I had assumed that the problem was "operator error" and that somehow I'd managed to save a tif with the ".kra" extension. Now I'm not so sure.
Hah, it was a different problem after all. The tiff file contained a Document entry which we take for the layer name; the name started with a /, which means the lpading code got really confused. Fixed in git.

The problem that was fixed in git is the problem with reopening kra files that were created from some tif files that have a particular metadata embedded, namely the "document name" metadata (unless I misread, always possible). I rebuilt Calligra/Krita from git, and indeed Krita can now open the GIMP-saved tiff with the odd "document name " metadata, save the file as a "kra" file, and then close and reopen the saved kra file.

However, the Krita "document name" (correct terminology? I mean the text on the tab) is very confusing, at least it seems that way to me: Krita says across the tab of the reopened kra file "/path/to/originally/opened/tif/original-tif-file-name.tif - name-of-kra-file.kra". And when I make changes and close the kra file without saving the changes, Krita says "The document '/path/to/originally/opened/tif/original-tif-file-name.tif' has been modified. Do you want to save it?"

But in fact the tif itself hasn't been modified. Only the kra file was modified. This confusing set of messages only happens when the tif file contains metadata that has the original file name embedded (read by exiftool as the "Document Name" tag). Does anyone else find this way of naming some but not all kra files a little confusing? I take it jpegs and pngs and exr files don't have this issue? as the metadata in question is only a tiff field?

Anyway, once I open a tif and save it as a kra file, that original tif path and file name doesn't really matter, and to make matters more confusing, it isn't updated when the file is saved to a new place and then opened from the new location. So Krita is currently displaying in the document name/tab a file path and name for a file that isn't there any more, in a folder that isn't there any more, that happens to be embedded in a tif that was opened from an entirely different folder. Bleh, it's confusing even to describe.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Could not read pixel data

Fri Jul 10, 2015 7:13 pm
Yes, I'll have to dig in deeper into that.
Elle Stone
Registered Member
Posts
43
Karma
1
OS

Re: Could not read pixel data

Fri Jul 10, 2015 7:28 pm
boudewijn wrote:Yes, I'll have to dig in deeper into that.

There are probably a zillion other issues that are more important than how Krita picks document names, but should I file a bug report?
User avatar
TheraHedwig
KDE Developer
Posts
1794
Karma
10
OS

Re: Could not read pixel data

Fri Jul 10, 2015 8:15 pm
Yes, files that go corrupt are considered the same priority if not higher as crashes.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot]