Skip to content

Commit

Permalink
Merge pull request #5 from Pfarrer/master
Browse files Browse the repository at this point in the history
Fixed type problem when watermarking images
  • Loading branch information
yurkinx committed Jul 9, 2014
2 parents 4c16aec + 86f34b8 commit 094488a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
22 changes: 11 additions & 11 deletions yii/image/drivers/Kohana/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,14 +500,14 @@ public function reflection($height = NULL, $opacity = 100, $fade_in = FALSE)
* $mark = Image::factory('upload/watermark.png');
* $image->watermark($mark, TRUE, TRUE);
*
* @param Image $watermark watermark Image instance
* @param integer $offset_x offset from the left
* @param integer $offset_y offset from the top
* @param integer $opacity opacity of watermark: 1-100
* @param Kohana_Image $watermark watermark Image instance
* @param integer $offset_x offset from the left
* @param integer $offset_y offset from the top
* @param integer $opacity opacity of watermark: 1-100
* @return $this
* @uses Image::_do_watermark
*/
public function watermark(Image $watermark, $offset_x = NULL, $offset_y = NULL, $opacity = 100)
public function watermark(Kohana_Image $watermark, $offset_x = NULL, $offset_y = NULL, $opacity = 100)
{
if ($offset_x === NULL)
{
Expand Down Expand Up @@ -724,13 +724,13 @@ abstract protected function _do_reflection($height, $opacity, $fade_in);
/**
* Execute a watermarking.
*
* @param Image $image watermarking Image
* @param integer $offset_x offset from the left
* @param integer $offset_y offset from the top
* @param integer $opacity opacity of watermark
* @param Kohana_Image $image watermarking Kohana_Image
* @param integer $offset_x offset from the left
* @param integer $offset_y offset from the top
* @param integer $opacity opacity of watermark
* @return void
*/
abstract protected function _do_watermark(Image $image, $offset_x, $offset_y, $opacity);
abstract protected function _do_watermark(Kohana_Image $image, $offset_x, $offset_y, $opacity);

/**
* Execute a background.
Expand Down Expand Up @@ -761,4 +761,4 @@ abstract protected function _do_save($file, $quality);
*/
abstract protected function _do_render($type, $quality);

} // End Image
} // End Image
12 changes: 6 additions & 6 deletions yii/image/drivers/Kohana/Image/GD.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,13 @@ protected function _do_reflection($height, $opacity, $fade_in)
/**
* Execute a watermarking.
*
* @param Image $image watermarking Image
* @param integer $offset_x offset from the left
* @param integer $offset_y offset from the top
* @param integer $opacity opacity of watermark
* @param Kohana_Image $image watermarking Kohana_Image
* @param integer $offset_x offset from the left
* @param integer $offset_y offset from the top
* @param integer $opacity opacity of watermark
* @return void
*/
protected function _do_watermark(Image $watermark, $offset_x, $offset_y, $opacity)
protected function _do_watermark(Kohana_Image $watermark, $offset_x, $offset_y, $opacity)
{
if (empty(Image_GD::$_available_functions[Image_GD::IMAGELAYEREFFECT]))
{
Expand Down Expand Up @@ -665,4 +665,4 @@ protected function _create($width, $height)
return $image;
}

} // End Image_GD
} // End Image_GD
4 changes: 2 additions & 2 deletions yii/image/drivers/Kohana/Image/Imagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ protected function _do_reflection($height, $opacity, $fade_in)
return FALSE;
}

protected function _do_watermark(Image $image, $offset_x, $offset_y, $opacity)
protected function _do_watermark(Kohana_Image $image, $offset_x, $offset_y, $opacity)
{
// Convert the Image intance into an Imagick instance
$watermark = new Imagick;
Expand Down Expand Up @@ -335,4 +335,4 @@ protected function _get_imagetype($extension)

return array($format, $type);
}
} // End Kohana_Image_Imagick
} // End Kohana_Image_Imagick

0 comments on commit 094488a

Please sign in to comment.