Skip to content

Add an option to remove the file extension from image uploads #412

@wwilsman

Description

@wwilsman

When using the percy upload command, the file extension is kept in snapshot names. This is because you can have multiple files with the same name but different extensions, i.e. image.png, image.jpg, image.jpeg. If file extensions were automatically removed, only the first upload will work and the following uploads will return a duplicate snapshot API error.

However, having matching filenames with differing extensions probably isn't very common. More likely what is common, is the filenames without extensions are intended to be snapshot names. With intentional names, the duplicate snapshot API error is doing its job.

Rather than change the behavior and suddenly rename all existing snapshots for current users (resulting in "new" snapshots and broken comparisons), we can add an opt-in flag and/or config file option to strip extensions from the resulting snapshot name. This could be a boolean option, or maybe a more complicated config option for more custom behaviors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions