1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-10-28 13:15:15 +01:00

calculate target dimensions

This commit is contained in:
Mikael Roos
2015-10-27 00:21:36 +01:00
parent f9a4205579
commit 9bf94e9cf6
3 changed files with 291 additions and 2 deletions

View File

@@ -404,6 +404,11 @@ class CImage
/*
* Class for image resizer.
*/
private $imageResizer = null;
/**
* Properties, the class is mutable and the method setOptions()
* decides (partly) what properties are created.
@@ -435,6 +440,7 @@ class CImage
{
$this->setSource($imageSrc, $imageFolder);
$this->setTarget($saveFolder, $saveName);
$this->imageResizer = new CImageResizer();
}
@@ -921,6 +927,8 @@ class CImage
if (empty($info)) {
throw new Exception("The file doesn't seem to be a valid image.");
}
$this->imageResizer->setSource($this->width, $this->height);
if ($this->verbose) {
$this->log("Loading image details for: {$file}");
@@ -935,8 +943,8 @@ class CImage
/**
* Init new width and height and do some sanity checks on constraints, before any
* processing can be done.
* Init new width and height and do some sanity checks on constraints,
* before any processing can be done.
*
* @return $this
* @throws Exception