mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-04 20:27:40 +02:00
Update Image.php
This commit is contained in:
@@ -243,6 +243,10 @@ class Image
|
|||||||
|
|
||||||
// Destroy an image
|
// Destroy an image
|
||||||
imagedestroy($old_image);
|
imagedestroy($old_image);
|
||||||
|
|
||||||
|
// Save new width and height
|
||||||
|
$this->width = $new_width;
|
||||||
|
$this->height = $new_height;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@@ -282,10 +286,14 @@ class Image
|
|||||||
imagefill($this->image, 0, 0, $transparent);
|
imagefill($this->image, 0, 0, $transparent);
|
||||||
|
|
||||||
// Copy and resize part of an image with resampling
|
// 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
|
// Destroy an image
|
||||||
imagedestroy($old_image);
|
imagedestroy($old_image);
|
||||||
|
|
||||||
|
// Save new width and height
|
||||||
|
$this->width = $width;
|
||||||
|
$this->height = $height;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@@ -651,3 +659,4 @@ class Image
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
code
|
||||||
|
Reference in New Issue
Block a user