diff --git a/libraries/Gelato/Image/Image.php b/libraries/Gelato/Image/Image.php index c42dd64..c9a3e4c 100644 --- a/libraries/Gelato/Image/Image.php +++ b/libraries/Gelato/Image/Image.php @@ -243,6 +243,10 @@ class Image // Destroy an image imagedestroy($old_image); + + // Save new width and height + $this->width = $new_width; + $this->height = $new_height; return $this; } @@ -282,10 +286,14 @@ class Image imagefill($this->image, 0, 0, $transparent); // Copy and resize part of an image with resampling - imagecopyresampled($this->image, $old_image, 0, 0, 0, 0, $width, $height, $width, $height); + imagecopyresampled($this->image, $old_image, 0, 0, $x, $y, $width, $height, $width, $height); // Destroy an image imagedestroy($old_image); + + // Save new width and height + $this->width = $width; + $this->height = $height; return $this; } @@ -651,3 +659,4 @@ class Image } } +code