Skip to content

Commit

Permalink
fix size when method
Browse files Browse the repository at this point in the history
  • Loading branch information
CostaRico committed Aug 11, 2014
1 parent 3dc07e8 commit b31d513
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions models/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,17 @@ public function getSizesWhen($sizeString){
if(!$size){
throw new \Exception('Bad size..');
}
$image = new \Imagick($this->getPathToOrigin());
$sizes = $image->getImageGeometry();

if($this->getModule()->graphicsLibrary == 'Imagick'){
$image = new \Imagick($this->getPathToOrigin());
$sizes = $image->getImageGeometry();
}else{
$image = new \abeautifulsite\SimpleImage($this->getPathToOrigin());
$sizes['width'] = $image->get_width();
$sizes['height'] = $image->get_height();
}


$imageWidth = $sizes['width'];
$imageHeight = $sizes['height'];
$newSizes = [];
Expand Down

0 comments on commit b31d513

Please sign in to comment.