Skip to content

Commit

Permalink
getSizes method
Browse files Browse the repository at this point in the history
  • Loading branch information
Enflow-io committed Oct 27, 2014
1 parent 1a4bbd8 commit fd60134
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions models/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,10 @@ public function getPathToOrigin(){
return $filePath;
}

public function getSizesWhen($sizeString){

$size = $this->getModule()->parseSize($sizeString);
if(!$size){
throw new \Exception('Bad size..');
}

public function getSizes()
{
$sizes = false;
if($this->getModule()->graphicsLibrary == 'Imagick'){
$image = new \Imagick($this->getPathToOrigin());
$sizes = $image->getImageGeometry();
Expand All @@ -109,6 +106,19 @@ public function getSizesWhen($sizeString){
$sizes['height'] = $image->get_height();
}

return $sizes;
}

public function getSizesWhen($sizeString){

$size = $this->getModule()->parseSize($sizeString);
if(!$size){
throw new \Exception('Bad size..');
}



$sizes = $this->getSizes();

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

0 comments on commit fd60134

Please sign in to comment.