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

Add support for webp_lossless to GD and GMagick #858

Merged
merged 1 commit into from
Feb 17, 2024

Conversation

ausi
Copy link
Contributor

@ausi ausi commented Feb 17, 2024

Fixes #857

The IMagick driver already supports the webp_lossless option, see

if (isset($options['webp_lossless'])) {
$image->setOption('webp:lossless', $options['webp_lossless']);
}

This pull request adds support for GD and GMagick too.

@ausi ausi mentioned this pull request Feb 17, 2024
@mlocati mlocati merged commit ebf9bb0 into php-imagine:develop Feb 17, 2024
21 checks passed
@jcogs-design
Copy link

Actually this doesn't fix #857. Not sure why anyone would think it does. It fixes a related problem in a different library, but to suggest this is a fix for #857 is just wrong.

@ausi
Copy link
Contributor Author

ausi commented Feb 18, 2024

It fixes a related problem in a different library, but to suggest this is a fix for #857 is just wrong.

I don’t understand. In #857 you wrote about “The saveOrOutput method in the GD\Image.php class has an explicit check (line 734)”. And this pull request fixes exactly that as it adds support for the webp_lossless option on line 733.

What do you mean by “different library”?
This pull request adds support for webp_lossless to GMagick and the GD library.

Did you test these changes?
The following code worked fine in my test:

$image = (new \Imagine\Gd\Imagine)->open('image.png');
$image->save('image.webp', ['webp_lossless' => true]);

If it doesn’t work for you, please provide the steps to reproduce the issue.

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

Successfully merging this pull request may close these issues.

Saving Lossless Webp?
3 participants