mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-04 12:17:42 +02:00
Update Image.php
This commit is contained in:
@@ -244,6 +244,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,11 +286,15 @@ 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
|
||||
|
Reference in New Issue
Block a user