GIMP 2.10 Auto-Save Recovery: Undo History and Layer Metadata Preservation Gap
0 reputation · 23 Jan 2022, 23:52 UTC
0 reputation · 23 Jan 2022, 23:52 UTC
GIMP 2.10 introduced a per-session auto-save mechanism that writes temporary XCF files at a configurable interval. When the application terminates unexpectedly, the most recent auto-save file remains and can be reopened via File → Recover, restoring pixel data up to the last saved interval. However, the recovered session does not consistently preserve the full editing context.
The auto-save preference (Environment → Save interval) and the separate backup-on-save feature (filename.xcf~) are documented as recovery aids. The backup-on-save naming convention and storage location vary by platform, but both mechanisms focus on pixel-layer fidelity. What remains unspecified is whether the recovery process should also restore the undo stack and layer-group visibility toggles.
Across the GIMP 2.10.x series, users report that recovered images retain pixel data but lose undo history and certain layer metadata such as group visibility states. This discrepancy has not been addressed in official documentation or standardized as expected behavior.
Does the current auto-save specification intend to preserve undo history and layer-group visibility on recovery? If preservation is intended, what configuration or version boundary defines when the gap is considered a bug versus a design limitation? Are there platform-specific factors in the backup-on-save path that affect metadata retention differently than the auto-save path?
35275 reputation · 24 Jan 2022, 01:20 UTC
In GIMP 2.10.x the auto‑save mechanism writes a temporary .xcf that contains the image’s pixel data and the current state of every layer and layer‑group – including visibility, opacity, and blending mode. The undo stack, however, is kept only in RAM and is not serialized into the auto‑save file. The same applies to the backup‑on‑save file (filename.xcf~). Consequently, when you recover via File → Recover you will see the exact layer‑group visibility that existed at the last auto‑save, but the Undo History dock will be empty.
It is an intentional design choice documented in the GIMP manual. No preference or version boundary enables undo persistence in auto‑save or backup‑on‑save files. Therefore the loss of undo history is a design limitation, not a bug, across all 2.10.x releases.
Only the file‑storage path differs (e.g. ~/Documents/GIMP‑2.10/ on Linux/macOS versus a ~ suffix on Windows). The content of the auto‑save and backup files is identical on all platforms, so metadata retention is consistent.
Enable auto‑save (Edit → Preferences → Environment → Save interval, e.g. 1 minute).
Open an image, perform several edits, and toggle a layer‑group’s visibility.
Force‑quit GIMP (Task Manager on Windows, kill on Linux/macOS).
Restart GIMP and choose File → Recover. Open the recovered file.
Check the Undo History dock – it should be empty. Inspect the Layers dialog – the visibility state should match the one you set before the crash.
Repeat the test with “Save backup copies” enabled to confirm that the .xcf~ file also lacks undo history.
.xcf~ that can be restored, but still without undo history.If you are using a version other than 2.10.28, please let me know the exact patch level. This will help confirm that the observed behavior matches the documented design across all 2.10.x releases.
Use comments to ask for clarification. Post a solution as an answer.
6,640 reputation · 24 Jan 2022, 11:33 UTC
The auto-save path in GIMP 2.10.x calls gimp_xcf_save() with the GIMP_XCF_SAVE_NO_UNDO flag, deliberately dropping the undo stack to keep temporary files small and writes fast. This is not a bug—it’s a documented trade-off in app/core/gimpimage-autosave.c.
Visibility flags are written as part of the layer tree, so a recovered file reflects the last completed auto-save tick. If a crash occurs between a UI toggle and the next interval, that toggle is lost—same as any pixel edit made since the last write.
The filename.xcf~ file created on explicit Save uses the full XCF serializer without the NO_UNDO flag, preserving undo history and exact layer metadata at that moment. Enabling “Create backup file” in Preferences does not affect auto-save behavior.
~/.config/GIMP/2.10/tmp/ vs. a manual backup .xcf~; the latter is larger due to undo data.GIMP 2.99/3.0 introduces a new recovery format that snapshots the full undo stack, but this is not back-ported to 2.10.x.