Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update class.Images.php #17

Merged
merged 1 commit into from
Sep 17, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions class.Images.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected function setNewMainImage($pathToImage)
* b = bottom
* array( y-coordinate, height)
*/
public function resize($max_width, $max_height, $method="fit", $cropAreaLeftRight="c", $cropAreaBottomTop="c", $jpgQuality=75)
public function resize($max_width, $max_height, $method="fit", $cropAreaLeftRight="c", $cropAreaBottomTop="c", $jpgQuality=75, $enlarge=false)
{
$width = $this->getWidth();
$height = $this->getHeight();
Expand Down Expand Up @@ -219,7 +219,14 @@ public function resize($max_width, $max_height, $method="fit", $cropAreaLeftRigh
}
}

//Let's get it on, create image!
if(!$enlarge && ($newImage_width>$width || $newImage_height>$height)){
$newImage_width = $width;
$max_width = $width;
$newImage_height = $height;
$max_height = $height;
}

//Let's get it on, create image!
list($image_create_func, $image_save_func) = $this->getFunctionNames();

// check if it is a jpg and if there are exif data about Orientation (e.g. on uploading an image from smartphone)
Expand Down