Skip to content
Permalink
Browse files

BUG Fixed divide by zero with SetRatioSize on missing image file

Fixes issue #2047
  • Loading branch information
tractorcow committed Jul 22, 2013
1 parent 58a2eb0 commit b3ca4a275bc10e82e85167a842d94d694c94ae0b
Showing with 3 additions and 0 deletions.
  1. +3 −0 model/Image.php
@@ -206,6 +206,9 @@ public function loadUploadedImage($tmpFile) {
*/
public function SetRatioSize($width, $height) {
// Prevent divide by zero on missing/blank file
if(empty($this->width) || empty($this->height)) return null;
// Check if image is already sized to the correct dimension
$widthRatio = $width / $this->width;
$heightRatio = $height / $this->height;

0 comments on commit b3ca4a2

Please sign in to comment.
You can’t perform that action at this time.