Improve XCF support
AbandonedPublic

Authored by sandsmark on Nov 11 2019, 10:32 PM.

Details

Summary

Now it can at least handle the simplest XCF files I have.

Biggest difference seems to be that they changed to 64bit for offsets from version 11 and upwards.

Still some issues with more complex layers (aka. not completely plain images), but this is better than nothing.

Test Plan

Tested with some simple XCFs I had laying around that didn't get thumbnails earlier.

Diff Detail

Repository
R287 KImageFormats
Lint
Lint Skipped
Unit
Unit Tests Skipped
sandsmark created this revision.Nov 11 2019, 10:32 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 11 2019, 10:32 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
sandsmark requested review of this revision.Nov 11 2019, 10:32 PM
sandsmark updated this revision to Diff 69617.Nov 11 2019, 11:08 PM

Forgot to fix the layer offset reading, and read the precision after instead of before the image properties

sandsmark updated this revision to Diff 69618.Nov 11 2019, 11:28 PM

Fixed masks as well, now even some more complex XCF files work again.

this very much needs test files :)

sandsmark updated this revision to Diff 79920.Apr 12 2020, 11:36 AM

Added test files (my own beautiful drawing).

sandsmark updated this revision to Diff 79924.Apr 12 2020, 12:29 PM

Implemented the last few properties that were missing for my beautiful XCF (not actually using them, though, I'm not in the mood to implement blending in the LAB color space).

sandsmark updated this revision to Diff 79925.Apr 12 2020, 1:09 PM

Fixed the layer composition modes, so now my fruit pilot got colors.

Now I think this is fairly complete, it should support most "normal" XCF files (as opposed to before, the current master only supports v0 files).

aacid added a comment.Apr 12 2020, 2:40 PM

the files are not uploaded correctly to phabricator so i can't check they work.

Given we just released KF 5.69 *yesterday* i'm going to go crazy and say commit this and we have a "whole month" to fix regressions if it has any...

sandsmark abandoned this revision.Apr 13 2020, 1:08 PM

I messed up and it got linked to the wrong phabricator review... Here it is anyways:

https://cgit.kde.org/kimageformats.git/commit/?id=c60e77c048d32ccf743cec695743b77b2b25dc87

Seems like I forgot to use the custom rand_r (to avoid exactly that + get the same noise function as windows) a couple of places.

Should just be to replace rand_r with RandomTable::rand_r where it is missing, okay if I just do that in master?

Seems like I forgot to use the custom rand_r (to avoid exactly that + get the same noise function as windows) a couple of places.

Should just be to replace rand_r with RandomTable::rand_r where it is missing, okay if I just do that in master?

Yeah fixing that directly in master makes sense

There, build fixed and all tests pass on msvc.

cfeck added a comment.Apr 15 2020, 1:17 PM

Thanks for your work, Martin! Could you please add a note (or resolve) bug 360821?