Export PNG hidden or deleted layers still get saved into the file.
GIMP version: latest 2.10.8 Operating System:
Package: [flatpak? Installer from gimp.org? If another installer, tell us where from] flatpak
Description of the bug
Please describe your issue with details. Add screenshot or other files if needed.
Reproduction
Is the bug reproducible? [Always / Randomly / Happened only once ] Always Reproduction steps:
- Create an image in Gimp with multiple layers
- Hide a layer
- Export to PNG
- Layer is still saved within PNG file, but only on certain software can see it.
Example I'm working with is for a title screen for video. my file is suppose to be 2 words, but other words show up when loaded into darktable, cinelera, or few others. The file size is 60K, if I open the file, create new layer, select and copy only the text I want to be shown (even though this is the only text I see anyway), paste it on the new layer, delete the old layer, save, export as png. My file size is 20k and the other words are not shown no matter what program I load it into.
Somehow the hidden or deleted layer is still being saved into the png file, but if you view with gimp, imagemagic, many others, this hidden layer is not seen. If you reopen in gimp, there is no visible sign that this data exists unless you look at the file size.
The smaller file attached doesn't have this data stored, and only way to correct it was how I described above, creating new layer, copying area I want, deleting layer, resave, export.
I've been trying to run through different programs via CLI to try to flatten, resize, something, to get it to rewrite the file without this data attached, but no success. …
Expected result: No hidden or deleted layers showing on PNG
Actual result: Layers reappearing if loaded in darktable or cinelerra and a few other programs. If reopen PNG in gimp, or many other viewers, the layers are not shown.
Additional information
I think I found a fix..
for i in Think*.png; do convert i -alpha on -background none -flatten out/
i; done
It gimp storing layer information in wrong area? Hope this helps. Thanks.
If you have a backtrace for a crash or a warning, paste it here.