Skip to content
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

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

Closed
RickCogley opened this issue Dec 28, 2023 · 3 comments
Closed

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

RickCogley opened this issue Dec 28, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@RickCogley
Copy link

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.

@RickCogley RickCogley added the bug Something isn't working label Dec 28, 2023
@oscarotero
Copy link
Member

Okay, thank you!
The extension detection must be case insensitive. I'll fix it for Lume 2.0.2

oscarotero added a commit that referenced this issue Dec 28, 2023
@oscarotero
Copy link
Member

Fixed. You can test it upgrading lume with deno task lume upgrade --dev.

@RickCogley
Copy link
Author

thank you for the quick work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants