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

Bugfix: Filter out parameter that do not match target encoder #1333

Merged
merged 12 commits into from Apr 23, 2024

Conversation

olivervogel
Copy link
Member

This deals with the problem that arises when format-unspecific encoders are provided with parameters that are not present in the final target encoder.

For example, the following call can take place with the quality argument.

// works if $image was created from jpeg, errors if image source is png for example
$encoded = $image->encode(new AutoEncoder(quality: 5));

If the source image and thus the target encoder supports quality (e.g. Jpeg), everything works fine. However, if the input format does not contain quality in the target encoder (e.g. PNG), an error occurs.

Unknown named parameter $quality

The logic has only been adapted since version 3.6, so this does not affect previous versions.

See #1332

@olivervogel olivervogel marked this pull request as draft April 22, 2024 15:21
@olivervogel olivervogel changed the title Filter out parameter that to not match to target encoder Filter out parameter that to not match target encoder Apr 22, 2024
@olivervogel olivervogel changed the title Filter out parameter that to not match target encoder Filter out parameter that do not match target encoder Apr 22, 2024
@olivervogel olivervogel changed the title Filter out parameter that do not match target encoder Bugfix: Filter out parameter that do not match target encoder Apr 22, 2024
@olivervogel olivervogel marked this pull request as ready for review April 22, 2024 17:37
@olivervogel olivervogel merged commit 33cbb21 into develop Apr 23, 2024
12 checks passed
@olivervogel olivervogel deleted the bugfix/encoder-parameters branch April 23, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant