Orama-Interactive / Pixelorama

Unleash your creativity with Pixelorama, a powerful and accessible open-source pixel art multitool. Whether you want to create sprites, tiles, animations, or just express yourself in the language of pixel art, this software will realize your pixel-perfect dreams with a vast toolbox of features. Available on Windows, Linux, macOS and the Web!
https://orama-interactive.itch.io/pixelorama
MIT License
6.93k stars 379 forks source link

CRITICAL DATA LOSS: Re-ordering tabs then saving renames files and overwrites without confirmation #901

Closed Deozaan closed 1 year ago

Deozaan commented 1 year ago

Pixelorama version: 0.11.1-stable

OS/device including version: Windows 10

Issue description: I had several numbered projects open. I then opened some more numbered projects as well, and then dragged the tabs around to put them into numerical order. Then I made some changes to some of the projects and saved with ctrl-s. Then I noticed my tabs were no longer in order so I re-ordered them again. After more work I noticed the tabs were mixed up again. So I decided it would be easiest to just close all my files and open them in the proper order.

When I opened them I saw that some of the filenames no longer matched the art in them, and some of the files had the same artwork as others, while some artwork was missing entirely. 😭

What I think happened: Dragging and dropping the tabs doesn't update some internal list/array of filenames. So if for example I have something called hero.pxo in the 3rd tab, and I drag it to the 5th tab so now the 3rd tab shows me monster.pxo, if I make changes to monster.pxo and press ctrl-s to save, it looks up some internally stored filename for the 3rd tab which it sees is stored as hero.pxo so the monster.pxo file gets renamed to (and overwrites) hero.pxo and if I happen to close hero.pxo before finding it and manually "saving as..." back to the original filename, I've lost the original hero.pxo artwork.

Steps to reproduce: Described above.

OverloadedOrama commented 1 year ago

Thanks for reporting, and sorry for the data loss. I managed to replicate this issue. I will take a look within the next few days when I have more time and release v0.11.2 that will include the fix for this bug.

OverloadedOrama commented 1 year ago

I think I have fixed the issue now in the latest commit. If you want, feel free to download a nightly version to confirm whether it still happens or not. If it does I will re-open the issue. Thanks again for the report!

https://nightly.link/Orama-Interactive/Pixelorama/workflows/dev-desktop-builds/master

Deozaan commented 1 year ago

I can no longer reproduce the error on the nightly version. 👍