mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-16 13:04:13 +02:00
adding testcases for #36
This commit is contained in:
11
CImage.php
11
CImage.php
@@ -167,6 +167,13 @@ class CImage
|
||||
private $newHeightOrig; // Save original value
|
||||
|
||||
|
||||
/**
|
||||
* Array with details on how to crop, incoming as argument and calculated.
|
||||
*/
|
||||
public $crop;
|
||||
public $cropOrig; // Save original value
|
||||
|
||||
|
||||
/**
|
||||
* Properties (clean up these)
|
||||
*/
|
||||
@@ -174,7 +181,6 @@ class CImage
|
||||
|
||||
public $keepRatio;
|
||||
public $cropToFit;
|
||||
public $crop;
|
||||
|
||||
private $cropWidth;
|
||||
private $cropHeight;
|
||||
@@ -388,8 +394,10 @@ class CImage
|
||||
$this->{$key} = $args[$key];
|
||||
}
|
||||
|
||||
// Save original values to enable re-calculating
|
||||
$this->newWidthOrig = $this->newWidth;
|
||||
$this->newHeightOrig = $this->newHeight;
|
||||
$this->cropOrig = $this->crop;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -642,6 +650,7 @@ class CImage
|
||||
|
||||
$this->newWidth = $this->newWidthOrig;
|
||||
$this->newHeight = $this->newHeightOrig;
|
||||
$this->crop = $this->cropOrig;
|
||||
|
||||
$this->initDimensions()
|
||||
->calculateNewWidthAndHeight();
|
||||
|
Reference in New Issue
Block a user