Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom palette file extension #1808

Open
MrStevns opened this issue Feb 4, 2024 · 4 comments
Open

Custom palette file extension #1808

MrStevns opened this issue Feb 4, 2024 · 4 comments

Comments

@MrStevns
Copy link
Member

MrStevns commented Feb 4, 2024

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?
@J5lx
Copy link
Member

J5lx commented Feb 4, 2024

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.

@scribblemaniac
Copy link
Member

scribblemaniac commented Feb 5, 2024

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.

@MrStevns
Copy link
Member Author

MrStevns commented Feb 5, 2024

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.

@chchwy
Copy link
Member

chchwy commented Feb 6, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Discussion
Development

No branches or pull requests

4 participants