Skip to content

Commit cbbfd84

Browse files
committed
.
1 parent d15b579 commit cbbfd84

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Image.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,9 @@ function insertImage(
327327
if ( !is_numeric( $srcHeight ) ) $srcHeight = $image->getHeight() - $srcY;
328328
if ( !is_numeric( $dstWidth ) ) $dstWidth = $srcWidth;
329329
if ( !is_numeric( $dstHeight ) ) $dstHeight = $srcHeight;
330-
$opacity = is_numeric( $opacity ) ? min( 1, max( 0, $opacity ) ) : 1;
330+
if ( !is_numeric( $opacity ) ) $opacity = 1;
331331

332-
if ( $opacity == 0 )
332+
if ( $opacity <= 0 )
333333
return clone $this;
334334

335335
if ( $opacity < 1 ) {
@@ -957,7 +957,7 @@ protected static function sqDistance( $arr1, $arr2, $l )
957957
* @return bool Удалось ли закодировать изображение
958958
* @throws \InvalidArgumentException Если указанный формат не поддерживается
959959
*/
960-
protected static function saveImage( $bitmap, $file, $type, $quality = 1.0 )
960+
protected static function saveImage( $bitmap, $file, $type, $quality = 0.75 )
961961
{
962962
switch ( $type ) {
963963
case IMAGETYPE_JPEG:

0 commit comments

Comments
 (0)