Jump to content

Export Persona: Text transformation options for slice format filenames


Recommended Posts

In Photo's / Designer's Export Persona we use slices to define regions that we'd like to export. A slice's export format has its resultant filename defined via path components: Variables and text. I think it would be useful if there were a few rudimentary text transformation options for the path (i.e. the filename). The user would pick the options they want and construct the transformation based upon their order:

  1. An option to find-and-replace a string with something else. For example, all spaces in a path could be replaced with hyphens, or be removed completely (no replacement string).
  2. Case conversion to lowercase, UPPERCASE, Sentence case, and Start Case.
    • With a few special cases: camelCase, PascalCase, snake_case, and kebab-case. Excluding camelCase, these could be created by combining a case conversion with one or more find-and-replaces, however having these built-in special cases ensures one can't construct them incorrectly. These special cases would automatically replace / remove any spaces, hyphens, or underscores, as needed.
  3. A slugify option for those that want a web-friendly output filename: "Some Image@2x2.webp" -> "some-image-2x2.webp".
    • Although this transformation would typically be used alone, I think it could still be able to be combined with the above two options: "Some Image@2x2.webp" -> "some.image.2x2.webp" (spaces-to-dots, slugify, then hyphens-to-dots).
    • Slugifying normally lowercases the input I believe, so an option to slugify without affecting case would be nice to avoid introducing any ambiguities.

The alternative solutions to the above feature request are:

  • Name all layers using the desired resultant filename formatting: The issues here are that legibility of layer names may be reduced, and if the desired formatting ever changes, all layers must be adjusted instead of simply using an adjusted text transformation at the export stage. Various export setup presets could be created per desired formatting.
  • Name all layers normally, but then on export, manually change each slice's name to the desired formatting (still laborious and error-prone).
  • Use an external tool to transform filenames after export (an additional manual step, although will likely be more configurable).

The case conversions and slugification options in particular would help streamline producing files that are ready for their intended purpose, for example for use in a website, Markdown document, codebase, or game engine.

Thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.