1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-07-31 13:40:08 +02:00

allow negative values for crop width & height

This commit is contained in:
Mikael Roos
2013-10-15 01:20:58 +02:00
parent d7b6f7e25d
commit e886c86f72
2 changed files with 4 additions and 3 deletions

View File

@@ -495,8 +495,8 @@ EOD;
$height = $this->height;
if($this->crop) {
$width = $this->crop['width'] = $this->crop['width'] == 0 ? $this->width : $this->crop['width'];
$height = $this->crop['height'] = $this->crop['height'] == 0 ? $this->height : $this->crop['height'];
$width = $this->crop['width'] = $this->crop['width'] <= 0 ? $this->width + $this->crop['width'] : $this->crop['width'];
$height = $this->crop['height'] = $this->crop['height'] <= 0 ? $this->height + $this->crop['height'] : $this->crop['height'];
if($this->crop['start_x'] == 'left') {
$this->crop['start_x'] = 0;