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

Support quality parameter via ImageTagHelper for webp format #302

Closed
zeto opened this issue Sep 9, 2022 · 4 comments
Closed

Support quality parameter via ImageTagHelper for webp format #302

zeto opened this issue Sep 9, 2022 · 4 comments
Labels

Comments

@zeto
Copy link

zeto commented Sep 9, 2022

It is possible to set the quality attribute for jpg:

e.g. <contentful-image jpg-quality="80">

However this doesn't seem possible with the webp format, even though it is supported underneath in the Images API. Can this parameter be exposed by webp-quality (or maybe unifiying both with a quality attribute) ?

Thank you!

@Roblinde
Copy link
Collaborator

@zeto thanks for the suggestion. Yes, the attribute is poorly named. It is only a wrapper for the quality attribute so if even if you have a webp image I think it should still work if you set the jpg-quality attribute, but I will make sure to rename it (or expose a new one) in the next release.

@zeto
Copy link
Author

zeto commented Sep 16, 2022

if (JpgQuality.HasValue && isJpg)
{
    queryBuilder.SetJpgQuality(JpgQuality.Value);
}

It gets discarded at the moment (thats how I found out) due to not being JPG which makes sense due to the name of the parameter, but maybe it should ignore the format, the images API documentation mentions non 8-bit PNGs. (AVIF maybe also applies ?)

I will make sure to rename it (or expose a new one) in the next release.

Thank you!

@Roblinde
Copy link
Collaborator

@zeto ah yes, it's discarded, that's unfortunate. I'll let you know when this is fixed and available.

@Roblinde Roblinde added the bug label Sep 19, 2022
@Roblinde
Copy link
Collaborator

@zeto thanks for your patience. This should now be fixed in version 7.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants