pencil
pencil copied to clipboard
Custom palette file extension
Issue Summary
There's been a small discussion going on, on the forum about our current palette extension which is plain .xml. The user advocate for a custom file extension like .pal or .col, for ease of file management.
Considering that all our files are .xml but renamed, it could make sense to give our palette its own extension too.
What should work:
- Backward compatibility with .xml files
- Importing and exporting a palette with the new palette, as well as saving the project.
- Do we still consider the .pcl format legacy? if not, make sure the new palette extension is also used here.
Changes involved:
- The extension should be added to fileformat.h:
- consider renaming PFF_DEFAULT_PALETTE_EXT to PFF_LEGACY_PALETTE_EXT, so that the new format can be the default and the legacy is .xml
- Update the palette_ext_filter
- Update FileManager::loadPalette(Object* obj) to support both formats.
- Update Object::savePalette to allow saving the palette using the new extension
- Do we need to support saving as .xml too?
Although I concur that a special purpose extension is nicer, changing it now will cause something of a hassle for what is essentially a cosmetic change. I’m especially sceptical of changing the extension internally in pcl(x) files, regardless of whether they are legacy or not. For bitmap projects this will only be a bit of an annoyance, but vector projects will get messed up by this when loaded in older versions (e.g. switching between stable and nightly), and our vector aficionado who suggested this change surely won’t take kindly to that. That aside, if we do go through with this let me suggest following the precedent set by pcls and call it something like pclp.
I’m especially sceptical of changing the extension internally in pcl(x) files, regardless of whether they are legacy or not. For bitmap projects this will only be a bit of an annoyance, but vector projects will get messed up by this when loaded in older versions (e.g. switching between stable and nightly), and our vector aficionado who suggested this change surely won’t take kindly to that. That aside, if we do go through with this let me suggest following the precedent set by pcls and call it something like pclp.
I generally agree with all of this. Changing the extension in the pclx file would not be backwards compatible and isn't worth breaking file compatibility for an aesthetic change in a place users shouldn't even be looking. I was going to suggest a pcl* name for the extension as well.
I don't see the making a new extension for the palette file as particularly important or useful in general, but I'm not opposed to the changes to importing/exporting as outlined here by @MrStevns. If it's for the interest of file management as suggested on the forum, it's trivial for users to adopt a file naming practice that makes it clear what the file is (ex.flowers.p2dpalette.xml
). There is some logic to making the change when looking at what we did for shortcuts though.
You both make a excellent points regarding the internal project structure. Depending on the workflow of our users and how much you value you put in file management, it could be considered a quality of life improvement, although cosmetic still.
The only way I see us being able to make it backward compatible, is to include both the old and new extension in the project, essentially keeping two copies of the project palette... I'm not saying we should do that though, I'm just mentioning it.
We could change only the file extension on exporting the palette without touching the filename in the pclx.
For backward compatibility, it should be fine if the newer versions of Pencil2D can consume both .xml
and .whatever-palette-ext
. The issue will be the forward compatibility as the older versions of Pencil2D won't be able to import the palette file with the new file extension.
Just want to discuss the possibility, I am personally neutral about this change.