Lottie save file with images gets corrupted
Steps to reproduce
- Create a new animation.
- Add an image.
- Save as lottie.
- Close glaxnimate.
- Open glaxnimate, load the save file.
- Move the image slightly (to force a resave).
- Ctrl-S to save the file.
- Repeat steps 5-7 a few times.
Result
Expected result: The file opens just how it was when I closed it.
Actual result: A new layer appears in the tree every time I save and reopen the file. They seemingly represent nothing, but deleting them causes problems.
Screenshot of tree after repeated saving:
Screenshot of error message after deleting one of these layers and reopening the file:
Version
Glaxnimate: 0.5.4-34-g9c9677a5
System: Arch Linux
Kernel: linux 6.5.7-arch1-1
CPU: x86_64
Application Qt: 5.15.11
System Qt: 5.15.11
ZLib: 1.3
Potrace: potracelib 1.16
Libav: Lavu58.2.100, Lavf60.3.100, Lavc60.3.100, SwS7.1.100
libarchive: 3.7.2
Here is the file I took the first screenshot of, before I deleted a layer: bug.json. I embedded the image inside the file, but the bug is still present when you don't do that.