aseprite / aseprite

Animated sprite editor & pixel art tool (Windows, macOS, Linux)

Home Page:https://www.aseprite.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sprite sheet JSON exporter outputs full filesystem path in meta.image

SaxxonPike opened this issue · comments

I propose replacing the absolute filesystem path in meta.image with a relative path instead.

When exporting a sprite sheet to JSON, the meta.image string contains the full filesystem path of the PNG image. Using absolute paths could reveal sensitive information about the machine on which the export was performed and also cause issues after moving files around if that information is used. Using relative paths instead would avoid this problem and make it easier for content management as well.

The workaround for now is to manually go in and remove this data from the exported JSON. Since making changes in Aseprite and exporting to a new sheet is a task we repeat very frequently, this effort adds up and also lends to making mistakes.

Here's an excerpt from a recently exported file using the Steam release:

    "meta": {
        "app": "http://www.aseprite.org/",
        "version": "1.2.4-x64",
        "image": "C:\\Users\\Saxxon\\Documents\\Sprite-0002.png",
        "format": "I8",

Here's that same excerpt with the proposed change:

    "meta": {
        "app": "http://www.aseprite.org/",
        "version": "1.2.4-x64",
        "image": "Sprite-0002.png",
        "format": "I8",

Thanks for your time!

Aseprite and System version

  • Aseprite version: v1.2.4 Steam
  • System: Windows 10 x64

Taking note about this one. A temporary fix would be to use the CLI from the C:\Users\Saxxon\Documents\ directory in this case (which it looks will generated your desired output):

C:\>cd C:\Users\Saxxon\Documents
C:\Users\Saxxon\Documents>"C:\Program Files (x86)\Steam\steamapps\common\Aseprite\aseprite.exe" -b Sprite-0002.ase --data Sprite-0002.json --sheet Sprite-0002.png