php-imagine / Imagine

PHP Object Oriented image manipulation library
https://imagine.readthedocs.io
Other
4.42k stars 530 forks source link

`setsamplingfactors()` is not the mirror of `getSamplingFactors()` #824

Closed PowerKiKi closed 2 years ago

PowerKiKi commented 2 years ago

Gmagick documentation, in https://www.php.net/manual/en/gmagick.setsamplingfactors.php, states that setsamplingfactors() takes an array of 3 floats that are "each color component (in RGB order)".

However https://www.php.net/manual/en/gmagick.getsamplingfactors.php, states that getsamplingfactors() will return an array of 2 floats that are the "horizontal and vertical sampling factor".

Newer version of Gmagick/PHP enforce this, so we cannot use the getter to get what we set. Instead we must adapt our expectations in our tests.

Fixes #782