Skip to content

Commit

Permalink
Fix mango signature warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed Nov 25, 2023
1 parent c71722f commit 336b6ac
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tools/signature/gd.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ public function setBackground( $path )
switch( $this->extension )
{
case MADGD_PNG:
$this->instance = imagecreatefrompng( $this->background );
$this->instance = @imagecreatefrompng( $this->background );
break;

case MADGD_GIF:
$this->instance = imagecreatefromgif( $this->background );
$this->instance = @imagecreatefromgif( $this->background );
break;

case MADGD_JPG:
case MADGD_JPEG:
$this->instance = imagecreatefromjpeg( $this->background );
$this->instance = @imagecreatefromjpeg( $this->background );
break;
}
return $this->instance;
Expand Down Expand Up @@ -182,7 +182,7 @@ public function HexRGB( $hex, $index = false )
{
if ( !is_array( $hex ) )
{
$hex = preg_replace( '/#/', null, $hex );
$hex = preg_replace( '/#/', '', $hex );
if ( strlen( $hex ) == 6 )
{
$hex = array(
Expand Down Expand Up @@ -319,19 +319,21 @@ public function setPosition( $x = MADGD_STACK, $y = 5 )
switch( $this->extension )
{
case MADGD_PNG:
$this->instance = imagecreatefrompng( $this->icon );
$this->instance = @imagecreatefrompng( $this->icon );
break;

case MADGD_GIF:
$this->instance = imagecreatefromgif( $this->icon );
$this->instance = @imagecreatefromgif( $this->icon );
break;

case MADGD_JPG:
case MADGD_JPEG:
$this->instance = imagecreatefromjpeg( $this->icon );
$this->instance = @imagecreatefromjpeg( $this->icon );
break;
}
return imagecopyresampled( $this->parent->instance, $this->instance, $this->parent->x, $this->parent->y, 0, 0, ( $this->width != null ? $this->width : $imageWidth ), ( $this->height != null ? $this->height : $imageHeight ), $imageWidth, $imageHeight );
return imagecopyresampled( $this->parent->instance, $this->instance, $this->parent->x, $this->parent->y,
0, 0, ( $this->width != null ? (int)$this->width : (int)$imageWidth ), ( $this->height != null ?
(int)$this->height : (int)$imageHeight ), (int)$imageWidth, (int)$imageHeight );
}
}

Expand Down

0 comments on commit 336b6ac

Please sign in to comment.