1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-08-12 02:54:09 +02:00

CImage::resize now crops using imagecopy without resamling.

This commit is contained in:
Mikael Roos
2014-12-15 09:41:11 +01:00
parent 2dbe33bd8e
commit 61e0473f47
3 changed files with 44 additions and 2 deletions

View File

@@ -1302,8 +1302,8 @@ class CImage
// Do as crop, take only part of image
$this->log("Cropping area width={$this->crop['width']}, height={$this->crop['height']}, start_x={$this->crop['start_x']}, start_y={$this->crop['start_y']}");
$img = $this->CreateImageKeepTransparency($this->crop['width'], $this->crop['height']);
//imgcopy
imagecopyresampled($img, $this->image, 0, 0, $this->crop['start_x'], $this->crop['start_y'], $this->crop['width'], $this->crop['height'], $this->crop['width'], $this->crop['height']);
//imagecopyresampled($img, $this->image, 0, 0, $this->crop['start_x'], $this->crop['start_y'], $this->crop['width'], $this->crop['height'], $this->crop['width'], $this->crop['height']);
imagecopy($img, $this->image, 0, 0, $this->crop['start_x'], $this->crop['start_y'], $this->crop['width'], $this->crop['height']);
$this->image = $img;
$this->width = $this->crop['width'];
$this->height = $this->crop['height'];