Hello for all.
Just want to inform about "warning" (not error) in core/Pageimage.php, line 312.
Scenario:
1. set debug mode (config.php, $config->debug = true;)
2. crop image with api in template with additional "cropping" params:
$small_image = $page->image->size(200, 120, $options['cropping'] = '50%,40%');
You will get this message (example is from my localhost, MS Windows):
Warning: strpos() expects parameter 1 to be string, array given in ...\wire\core\Pageimage.php on line 312
If you use this format "50%x40%" ("x" separated, not with comma ",") than there is no warning message.
For interested, reason for that (if using comma separated values) is on line 277, 278.
Possible temporary fix solutions:
1. additional check inside "if" statement
if(!is_array($options['cropping']) && strpos($options['cropping'], 'x')... // line 312, core/Pageimage.php
or
2. using error control operator in "if" statement (line 312, core/Pageimage.php)
if(@strpos($options['cropping'], 'x') === 0 && preg_match('/^x(\d+)[yx](\d+)/', $options['cropping'], $matches))
or ...
Regards.