diff --git a/src/Grafika/EditorInterface.php b/src/Grafika/EditorInterface.php index e240942..8be7ac5 100644 --- a/src/Grafika/EditorInterface.php +++ b/src/Grafika/EditorInterface.php @@ -30,7 +30,7 @@ public function apply( &$image, $filter ); * * @return EditorInterface An instance of Editor. */ - public function blend(&$image1, $image2, $type='normal', $opacity = 1.0, $position = 'top-left', $offsetX = 0, $offsetY = 0 ); + public function blend(ImageInterface &$image1, ImageInterface $image2, $type = 'normal', float $opacity = 1.0, string $position = 'top-left', int $offsetX = 0, int $offsetY = 0); /** * Compare two images and returns a hamming distance. A value of 0 indicates a likely similar picture. A value between 1 and 10 is potentially a variation. A value greater than 10 is likely a different image. @@ -252,4 +252,4 @@ public function save( $image, $file, $type = null, $quality = null, $interlace = */ public function text( &$image, $text, $size = 12, $x = 0, $y = 12, $color = null, $font = '', $angle = 0 ); -} \ No newline at end of file +} diff --git a/src/Grafika/Gd/Editor.php b/src/Grafika/Gd/Editor.php index 1fb29a5..808bcbc 100644 --- a/src/Grafika/Gd/Editor.php +++ b/src/Grafika/Gd/Editor.php @@ -54,7 +54,7 @@ public function apply( &$image, $filter) * @return Editor * @throws \Exception When added image is outside of canvas or invalid blend type */ - public function blend(&$image1, $image2, $type='normal', $opacity = 1.0, $position = 'top-left', $offsetX = 0, $offsetY = 0 ){ + public function blend(ImageInterface &$image1, ImageInterface $image2, $type='normal', float $opacity = 1.0, string $position = 'top-left', int $offsetX = 0, int $offsetY = 0) { // Turn into position object $position = new Position($position, $offsetX, $offsetY); @@ -113,7 +113,7 @@ public function blend(&$image1, $image2, $type='normal', $opacity = 1.0, $positi $type = strtolower( $type ); if($type==='normal') { - if ( $opacity !== 1 ) { + if ( $opacity !== 1.0 ) { $this->opacity($image2, $opacity); } imagecopy( $canvas, $gd2, $loopStartX + $offsetX, $loopStartY + $offsetY, 0, 0, $image2->getWidth(), $image2->getHeight()); @@ -1176,4 +1176,4 @@ private function _smartCrop($oldImage, $cropW, $cropH){ return array($x,$y); } -} \ No newline at end of file +} diff --git a/src/Grafika/Imagick/Editor.php b/src/Grafika/Imagick/Editor.php index 36d698f..d65052d 100644 --- a/src/Grafika/Imagick/Editor.php +++ b/src/Grafika/Imagick/Editor.php @@ -53,8 +53,8 @@ public function apply(&$image, $filter) * @return Editor * @throws \Exception When added image is outside of canvas or invalid blend type */ - public function blend(&$image1, $image2, $type='normal', $opacity = 1.0, $position = 'top-left', $offsetX = 0, $offsetY = 0 ){ - + public function blend(ImageInterface &$image1, ImageInterface $image2, $type = 'normal', float $opacity = 1.0, string $position = 'top-left', int $offsetX = 0, int $offsetY = 0) + { // Turn into position object $position = new Position($position, $offsetX, $offsetY); @@ -86,7 +86,7 @@ public function blend(&$image1, $image2, $type='normal', $opacity = 1.0, $positi $loopStartY += $diff; } - if ( $opacity !== 1 ) { + if ( $opacity !== 1.0 ) { $this->opacity($image2, $opacity); } @@ -824,4 +824,4 @@ private function _getImageTypeFromFileName($imageFile) } } -} \ No newline at end of file +}