Export animated GIFs with dispose background frames

Closes GH-14 where flashing text in Mix mode would not flash to the
transparent background.

The bundled QtGifImage does not expose a way to change the DisposalMode in
giflib and thus it is fixed at 0 or DISPOSAL_UNSPECIFIED. This is a quick and
dirty change to fix it to 2 or DISPOSAL_BACKGROUND for our needs.

A proper fix would be to fork QtGifImage and add a more accessible API call
to choose the DisposalMode value.
This commit is contained in:
Gavin MacGregor
2025-12-01 22:09:49 +00:00
parent dbbeea9d30
commit fcca93e5a5

View File

@@ -306,7 +306,7 @@ bool QGifImagePrivate::save(QIODevice *device) const {
}
GraphicsControlBlock gcbBlock;
gcbBlock.DisposalMode = 0;
gcbBlock.DisposalMode = 2;
gcbBlock.UserInputFlag = false;
gcbBlock.TransparentColor = getFrameTransparentColorIndex(frameInfo);