@@ -64,6 +64,9 @@ public function compressImage($sourceURL, $destinationURL, $minImgWidth, $wmImag
6464 // width to calculate positioning of the watermark.
6565 imagecopy ($ image , $ watermark , imagesx ($ image ) - $ sx - $ positionRight , imagesy ($ image ) - $ sy - $ positionBottom , 0 , 0 , imagesx ($ watermark ), imagesy ($ watermark ));
6666
67+ imagealphablending ($ image , false );
68+ imagesavealpha ($ image , true );
69+
6770 imagecopyresampled ($ imgResource , $ image , 0 , 0 , 0 , 0 , $ newWidth , $ newHeight , $ width , $ height );
6871 } elseif ($ infoImg ['mime ' ] == 'image/gif ' ){
6972 $ image = imagecreatefromgif ($ sourceURL );
@@ -75,6 +78,9 @@ public function compressImage($sourceURL, $destinationURL, $minImgWidth, $wmImag
7578 // width to calculate positioning of the watermark.
7679 imagecopy ($ image , $ watermark , imagesx ($ image ) - $ sx - $ positionRight , imagesy ($ image ) - $ sy - $ positionBottom , 0 , 0 , imagesx ($ watermark ), imagesy ($ watermark ));
7780
81+ imagealphablending ($ image , false );
82+ imagesavealpha ($ image , true );
83+
7884 imagecopyresampled ($ imgResource , $ image , 0 , 0 , 0 , 0 , $ newWidth , $ newHeight , $ width , $ height );
7985 }
8086
0 commit comments