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

Missing fit modes on cloudinary provider, and existing ones are wrongly mapped #1354

Open
ptdev opened this issue May 6, 2024 · 4 comments
Labels
bug Something isn't working enhancement New feature or request provider

Comments

@ptdev
Copy link
Contributor

ptdev commented May 6, 2024

Hey,

The cloudinary provider is missing some fit modes that are supported by Cloudinary.

Specifically, I was looking to use the "lfill" mode, which as far as I can see, is the equivalent to the "cover" mode in nuxt-image.

But after looking into the source code, nuxt-image is apparently mapping the "cover" mode with cloudinary's "fit" mode which are not equivalent.

According to nuxt-image docs, the "cover" mode states:

Preserving aspect ratio, ensure the image covers both provided dimensions by cropping/clipping to fit

While cloudinary's "fit" mode does not crop or clip images. From their docs regarding their "fit" mode, they state:

(...) The original aspect ratio is retained and all of the original image is visible

Also, doing a test with the same image using ipx and cloudinary using default values yields different images which further confirms the mappings for the fit modes are not totally correct.

Cheers!

@ptdev ptdev changed the title Missing fit modes on cloudinary provider, and existing ones are mapped wrongly Missing fit modes on cloudinary provider, and existing ones are wrongly mapped May 6, 2024
Copy link
Member

Improvement would be welcome 🙏

@danielroe danielroe added bug Something isn't working enhancement New feature or request provider labels May 7, 2024 — with Volta.net
@ptdev
Copy link
Contributor Author

ptdev commented May 7, 2024

Hey,

I've submitted a 1 line PR with just the correct mapping for nuxt-image's default "cover" fit mode to the correct cloudinary fit mode (lfill).

As for the other missing cloudinary fit modes, since they're mapped to different names, I'll leave that for the nuxt team as I'm not sure how to name them 😕

Cheers

@danielroe
Copy link
Member

@ptdev How would you describe the issue with other fit modes? Would you give an example of what you're trying that isn't working?

@ptdev
Copy link
Contributor Author

ptdev commented May 7, 2024

Hey,

Thanks for the merge.

I didn't actually came across any issues with the missing modes.

It was just that when I was investigating the issue with the cover<->lfill mapping and looking at cloudinary's documentation, I noticed that cloudinary appears to have some more modes that are not on this module.

But looking at it closer now it seems it's just missing the "fill_pad" and auto modes which maybe don't even apply.

And their "fit" mode is now also unmapped after switching it to the correct "lfill" mode.

I honestly do not need any other modes so didn't get quite into all details, sorry.

Cheers. 👍

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

No branches or pull requests

2 participants