diff --git a/lib/ImageResize.php b/lib/ImageResize.php index 795d0cb..7ce3605 100644 --- a/lib/ImageResize.php +++ b/lib/ImageResize.php @@ -241,9 +241,9 @@ public function save($filename, $image_type = null, $quality = null, $permission $background = imagecolorallocate($dest_image, 255, 255, 255); imagefilledrectangle($dest_image, 0, 0, $exact_size[0], $exact_size[1], $background); } else{ - $dest_image = imagecreatetruecolor($this->getDestWidth(), $this->getDestHeight()); + $dest_image = imagecreatetruecolor((int) $this->getDestWidth(), (int) $this->getDestHeight()); $background = imagecolorallocate($dest_image, 255, 255, 255); - imagefilledrectangle($dest_image, 0, 0, $this->getDestWidth(), $this->getDestHeight(), $background); + imagefilledrectangle($dest_image, 0, 0, (int) $this->getDestWidth(), (int) $this->getDestHeight(), $background); } break; @@ -337,12 +337,12 @@ public function save($filename, $image_type = null, $quality = null, $permission $this->source_image, $this->dest_x, $this->dest_y, - $this->source_x, - $this->source_y, - $this->getDestWidth(), - $this->getDestHeight(), - $this->source_w, - $this->source_h + (int) $this->source_x, + (int) $this->source_y, + (int) $this->getDestWidth(), + (int) $this->getDestHeight(), + (int) $this->source_w, + (int) $this->source_h ); if ($this->gamma_correct) { @@ -712,7 +712,7 @@ public function getSourceHeight() /** * Gets width of the destination image * - * @return integer + * @return integer|float */ public function getDestWidth() { @@ -721,7 +721,8 @@ public function getDestWidth() /** * Gets height of the destination image - * @return integer + * + * @return integer|float */ public function getDestHeight() {