1
0
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:
Mikael Roos
2014-09-01 00:38:26 +02:00
parent 63112f58b1
commit 8523ef5e31
6 changed files with 318 additions and 3 deletions

View File

@@ -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();