@@ -64,6 +64,9 @@ public function compressImage($sourceURL, $destinationURL, $minImgWidth, $wmImag
64
64
// width to calculate positioning of the watermark.
65
65
imagecopy ($ image , $ watermark , imagesx ($ image ) - $ sx - $ positionRight , imagesy ($ image ) - $ sy - $ positionBottom , 0 , 0 , imagesx ($ watermark ), imagesy ($ watermark ));
66
66
67
+ imagealphablending ($ image , false );
68
+ imagesavealpha ($ image , true );
69
+
67
70
imagecopyresampled ($ imgResource , $ image , 0 , 0 , 0 , 0 , $ newWidth , $ newHeight , $ width , $ height );
68
71
} elseif ($ infoImg ['mime ' ] == 'image/gif ' ){
69
72
$ image = imagecreatefromgif ($ sourceURL );
@@ -75,6 +78,9 @@ public function compressImage($sourceURL, $destinationURL, $minImgWidth, $wmImag
75
78
// width to calculate positioning of the watermark.
76
79
imagecopy ($ image , $ watermark , imagesx ($ image ) - $ sx - $ positionRight , imagesy ($ image ) - $ sy - $ positionBottom , 0 , 0 , imagesx ($ watermark ), imagesy ($ watermark ));
77
80
81
+ imagealphablending ($ image , false );
82
+ imagesavealpha ($ image , true );
83
+
78
84
imagecopyresampled ($ imgResource , $ image , 0 , 0 , 0 , 0 , $ newWidth , $ newHeight , $ width , $ height );
79
85
}
80
86
0 commit comments