-
-
Notifications
You must be signed in to change notification settings - Fork 167
Add .piskel extension #541
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
Conversation
Like SVGs, these are stored as plain text, but are not meant to be hand-edited. The “identify” library doesn't recognise *.piskel files as images. Match them by filename. I submitted pre-commit/identify#541 to teach identify about these files; if that change is accepted and released this could be reverted.
identify/extensions.py
Outdated
| 'php4': {'text', 'php'}, | ||
| 'php5': {'text', 'php'}, | ||
| 'phtml': {'text', 'php'}, | ||
| 'piskel': {'text', 'image', 'piskel', 'json'}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the image tag was an idea that didn't really pan out so I'm just going to remove it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a shame, because in this case the image tag is just what we want!
Piskel is a browser-based sprite editor. Its file format is JSON-based (though the JSON contains base64-encoded PNG data). Recognise the .piskel extension and identify it analogously to .svg: it is text, image, json and piskel. https://github.com/piskelapp/piskel http://justsolve.archiveteam.org/wiki/Piskel_canvas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My upstream pull request was merged: - pre-commit/identify#541 The maintainer chose to edit my contribution to not add the `image` tag to piskel files: > the `image` tag was an idea that didn't really pan out so I'm just > going to remove it here Of course that's their prerogative as maintainer! Unfortunately this means that my plan from commit e92fd6d, to exclude all image files with `exclude_types: [image]`, is not going to work. Instead we have to add the `piskel` type explicitly to the list, and also any further text-based image file formats that we find in future. Add `piskel` to the exclude list. Replace the `image` type with `svg`: `svg` is the only format with that type, and since that tag will not be applied to any new formats, it's clearer to be explicit. Remove the regex branches that match piskel files by name. If you have `pre-commit` set up locally, this change will cause the hook to fail: =====> Type tag 'piskel' is not recognized. Try upgrading identify and pre-commit? If you installed `pre-commit` with `uv tool install` you can run: uv tool upgrade pre-commit

Piskel is a browser-based sprite editor. Its file format is JSON-based (though the JSON contains base64-encoded PNG data).
Recognise the .piskel extension and identify it analogously to .svg: it is text, image, json and piskel.
https://github.com/piskelapp/piskel
http://justsolve.archiveteam.org/wiki/Piskel_canvas