Skip to content

Image transform does not work with all caps JPG extension #542

@RickCogley

Description

@RickCogley

Version

2

Platform

macOS, Netlify

What steps will reproduce the bug?

If you have something like:

<img src="{{ it.img }}" alt="Bio page photo for {{ name }}, {{ position }}" width="600" transform-images="avif webp jpg 600@2">

.... but upload an image with an extension of JPG in upper case, the transformation does not work.

How often does it reproduce? Is there a required condition?

It's consistent, and I found out in the nwtn repo. The plugin won't render the transforms if the original is whatever.JPG. It must be whatever.jpg.

What is the expected behavior?

Users will upload whatever image format they get, if they are uploading to media folder via decapCMS for instance. They won't follow a rule like "the extension must be lowercase".

What do you see instead?

I'd like the plugin to be forgiving, and simply work, even if someone uploads whateverimage.JPG with an all caps extension.

Additional information

I didn't try but, it may be possible to set in plugin settings? [ ".jpg", ".jpeg", ".png" ] I think the default should just allow the variants, because cameras still export files with JPG as capitals, and also there might be some dumb situation where it's something.Jpg though I've never seen it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions