I have an .xcf file I created that is now unreadable: Gimp says
"Opening -filename- failed: Plug-in could not open image."
Kolourpaint says "The file may be corrupt."
The image has two layers, one can be discarded, so even if I could
extract one layer from it as a PNG or something that would save my
bacon. I've heard about using dd or somesuch to do such things but
I've not used dd before, it sounds a little scary.
What happened you ask? Well, the file is on an external (IDE) drive.
While editing it in Gimp I unknowingly had an "Open" dialogue box in
the background for a while, and during this time I turned off and
turned on the external drive twice. Somehow Nautilus got into a state
where it thought I had multiple external drives, and so they showed up
as different external media called "Drive", "Drive_", and "Drive__" ,
with only the last one accesible. This also was reflected in Gimp's
"File Open" dialogue. So I eventually saved my file onto "Drive__".
Later on I noticed this weirdness, closed Gimp and restored the
external media to being mounted on "Drive". And then the file (but
just that one file) can't be opened. I didn't recall exactly the
chain of events that led to the weird condition with multiple mount
points, and I tried and failed to recreate it.
Things I've tried:
- editing fstab and mounting the drive at "Drive__" and reopening the
file, didn't work
- opening the file in Kolourpaint, didn't work
- xcftools can't read it at all, it says "
xcf2png: Corrupted or malformed XCF file:
Not an XCF file at all (magic not recognized)
Warning: program returned non-zero exit code #125
"
when I try to view it with xcfview.
Can any experts help me out here? Either opening the file
successfully (in Gimp or otherwise) or extracting a layer from it?
Many thanks!
Mark
> Hi experts, I need some help here.
> GIMP: 2.2.13
> OS: Ubuntu 7.04 Feisty kernel: 2.6.20-17-generic
>
> I have an .xcf file I created that is now unreadable: Gimp says "Opening
> -filename- failed: Plug-in could not open image." Kolourpaint says "The
> file may be corrupt." The image has two layers, one can be discarded, so
> even if I could extract one layer from it as a PNG or something that
> would save my bacon. I've heard about using dd or somesuch to do such
> things but I've not used dd before, it sounds a little scary.
>
<big snip>
Interesting but it is not looking good, seems the header is corrupt.
A quick test - using a 2 layer .xcf file and a hex editor
1. Corrupt end of file (overwrite a section with zeros)
Gimp will open the first layer with this message
This XCF file is corrupt! I have loaded as much of it as I can, but it
is incomplete.
This did indeed load the first layer but not the second.
-------------------
2. Corrupt section near the front - this message
Opening '/home/rich/test2.xcf' failed:
This XCF file is corrupt! I could not even salvage any partial image
data from it.
------------------
3. Corrupt header - the first 400 odd bytes
Opening '/home/rich/test3.xcf' failed:
GIMP XCF image plug-In could not open image
-----------------
Tried an imagemagick conversion on each - no good.
Tried grafting a header from a new file into the file with the corrupt
header - back to option 2 - no good.
It might still be worth using a hex editor just to see how much of the
file is corrupt. If it is a few bytes in the header then it might be
repairable. If it is a big block of zeros then I think it is deceased.
--
rich
Thanks for the tests and info, Rich. I fiddled with the file for an
hour or so with a hex editor and tried similar things as you and also
had no luck, prepending a blank image, merging with a working file,
etc. But I couldn't easily figure out where the header stops and
where the content starts. I don't see any large zero blocks, at least
any large blocks that look different from another (working) file.
If emailed you the file would you be able to have a look at it
yourself? (it is 8mb)
Many thanks
Mark
I can try but it is unlikely that I can do anything that you have not
already done.
Rather than an email can you pop it onto a free file sharing service such
as www.rapidshare.com or www.filefront.com
--
rich
Rich, many thanks again for helping out another anonymous web
denizen. I'd appreciate any time you could spend fiddling with it.
http://rapidshare.com/files/317715588/newpage10.xcf.html
Mark
I think it is scrap, maybe someone can have a go.
My findings
a gimp .xcf file is composed of segments
a header
the layer(s) - starting with their name(s)
Background - starting with "Background"
Your file certainly looks like it is a .xcf from 'somewhere' to the end,
the last few hundred bytes match, however nowhere is there anything to
mark the start of a 'Background' which would be the last segment.
Very, very long shot
Since it came from an external drive have you run photorec on the drive -
part of the testdisk package (should be in the ubuntu repo).
If you have not used the external drive too much there might be something
to recover.
--
rich
I can reconstruct the image as it was part of a large series and I can
deduce what is in it. Thanks again for trying. I'll back up more
frequently next time ...
mark