Invalid Alpha when shrinking canvas and export creates invalid TIFF
I have found this scenario to be quite reproducible, I have ruined many TIFF files and it was hard to track the origin. It happens for me both on MacOS 10.6 compiled with MacPorts as with an official Windows binary.
- open a TIFF file (greyscale or RGB, but no Alpha), my examples are all photographs and quite big
- resize the canvas by removing the left and top borders (that is, negative numbers). Removing pixels from bottom or right doesn't seem to reproduce the problem
- export back the TIFF, the tiff is invalid and only a few bytes big
I think two problems cause this scenario together.
the resized image is saved as native GIMP file. Te XCF file can be reopened fine, however, a new export causes again an invalid TIFF.
I was able to "fix" the issue by running a "flatten" image before. However, no alpha channel is shown.
What I think happens is that 2) resize causes an invisible alpha layer to be created, which the TIFF export doesn't like. Flatten fixes this. This information is "saved" in the XCF file. If I have created an image which exports "badly" and notice that, I can just run flatten and re-export and the TIFF is valid.
I am not yet able to reproduce this error with just a random small image so that I can attach a small example file to the bug.