From c1bc59fbb5f31486b9e6040e879d1ea4c255dc91 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 7 Nov 2010 15:38:45 -0800 Subject: Force the new geometry in the ImageMagick crop() function. Fixes http://dev.kohanaframework.org/issues/3384 --- system/libraries/drivers/Image/ImageMagick.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system') diff --git a/system/libraries/drivers/Image/ImageMagick.php b/system/libraries/drivers/Image/ImageMagick.php index 31862f75..55c0ba24 100644 --- a/system/libraries/drivers/Image/ImageMagick.php +++ b/system/libraries/drivers/Image/ImageMagick.php @@ -133,7 +133,7 @@ class Image_ImageMagick_Driver extends Image_Driver { // Set the IM geometry based on the properties $geometry = escapeshellarg($prop['width'].'x'.$prop['height'].'+'.$prop['left'].'+'.$prop['top']); - if ($error = exec(escapeshellcmd($this->dir.'convert'.$this->ext).' -background '.$this->background.' -flatten -crop '.$geometry.' '.$this->cmd_image.' '.$this->cmd_image)) + if ($error = exec(escapeshellcmd($this->dir.'convert'.$this->ext).' -background '.$this->background.' -flatten -crop '.$geometry.'! '.$this->cmd_image.' '.$this->cmd_image)) { $this->errors[] = $error; return FALSE; -- cgit v1.2.3 From dca9b5f3fc8e80ee0667cac88d688e2287b1e7f4 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 18 Nov 2010 09:48:50 -0800 Subject: Fix a bug in ORM where calling reload() on an unloaded instance returns the first instance in the database, which is super bad. Kohana ticket: http://dev.kohanaframework.org/issues/3397 Related G3 ticket: http://sourceforge.net/apps/trac/gallery/ticket/1489 --- system/libraries/ORM.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'system') diff --git a/system/libraries/ORM.php b/system/libraries/ORM.php index 4dd2eaf0..eb34221c 100644 --- a/system/libraries/ORM.php +++ b/system/libraries/ORM.php @@ -1002,7 +1002,11 @@ class ORM_Core { */ public function reload() { - return $this->find($this->object[$this->primary_key]); + if ($this->_loaded) { + return $this->find($this->object[$this->primary_key]); + } else { + return $this->clear(); + } } /** -- cgit v1.2.3