j-jorge/xcftools

Layer groups render twice

Opened this issue · 1 comments

When exporting an XCF with layer groups the layers inside groups are rendered twice. xcfinfo gives a clue why:

http://al.robotfuzz.com/~al/random/test.xcf

  • 128x128+0+0 RGB-alpha Normal Layer Group
  • 128x128+0+0 RGB-alpha Normal layer 1
  • 128x128+0+0 RGB-alpha Normal layer 2

Here layer 1 is in the layer group but layer 2 is not. "Layer group" appears like a normal layer. It seems that layer 1 gets rendered twice. Once as part of the layer group and once in the normal paths.

If the layers contain transparency or special blending modes the result won't look right.

I just realised I'm not using your fork, so I downloaded it and compiled it. The image output is the same, though the xcfinfo output is different:

Version 3, 128x128 RGB color, 3 layers, compressed RLE

  • 128x128+0+0 RGB-alpha Normal/group |Layer Group
  • 128x128+0+0 RGB-alpha Normal |Layer Group|layer 1
  • 128x128+0+0 RGB-alpha Normal |layer 2

But, the output PNG still looks wrong compared to the source test.xcf

This is the xcf rendered with groups:
test

This is the same layers but without the group:
test-nogroup