Skip to content

Commit 5fa363b

Browse files
committed
crop made compatible with previous versions
1 parent e661398 commit 5fa363b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/ImageResize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public function resize($width, $height, $allow_enlarge = false)
366366
* @param integer $position
367367
* @return \static
368368
*/
369-
public function crop($width, $height, $position = self::CROPCENTER, $allow_enlarge = false)
369+
public function crop($width, $height, $allow_enlarge = false, $position = self::CROPCENTER)
370370
{
371371
if (!$allow_enlarge) {
372372
// this logic is slightly different to resize(),

test/Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public function testCropPosition()
225225
$image = $this->createImage(200, 100, 'png');
226226
$resize = new ImageResize($image);
227227

228-
$resize->crop(50, 50, $resize::CROPRIGHT, false);
228+
$resize->crop(50, 50, false, $resize::CROPRIGHT);
229229

230230
$reflection_class = new ReflectionClass('\Eventviva\ImageResize');
231231
$source_x = $reflection_class->getProperty('source_x');

0 commit comments

Comments
 (0)