-
Notifications
You must be signed in to change notification settings - Fork 2
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
Docs update: API $config->imageSizerOptions missing key "sharpening" #409
Comments
You don't say exactly how you are setting the imageSizerOptions in /site/config.php, but be aware that for config settings that are arrays (as imageSizerOptions is) you must merge your settings with the default settings. So for instance you cannot do this: $config->imageSizerOptions['upscaling'] = false; But must instead do: $config->imageSizerOptions = array_merge($config->imageSizerOptions, ['upscaling' => false]); |
I guess it's my mistake: I did in config.php
Thank you for pointing towards array_merge() – I did miss that. |
I don't think it's documented anywhere - it's just what I've found from personal experience. You would think you would be able to set individual array values by key but for some reason it doesn't work. |
And you are right in that if the API docs are going to state the defaults then they should be the complete defaults. I think you should reopen this issue so the API docs get updated. |
You can also do this for any array property when you just want to set one part of it: |
There are now just too many imageSizerOptions to fit within the phpdoc in that class, so I've updated the note to say "see /wire/config.php for all options and defaults". |
@esszett Hello there. Could you close this issue if it is resolved to your satisfaction, otherwise post a reply so we know to keep it open and on the radar. Thank you! |
Setting imageSizerOptions in config.php as written in the API-docs is generating a PHP Notice: "Undefined index: sharpening in .../www/wire/core/Pageimage.php:512"
Expected behavior
Docs should mention key "sharpening"
Optional: Suggestion for a possible fix
Add "sharpening" and possible values "soft, …" to API docs
Setup/Environment
The text was updated successfully, but these errors were encountered: