Skip to content

Commit b37f5e7

Browse files
authored
Update az.multi.upload.class.php
1 parent 705a16f commit b37f5e7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

az.multi.upload.class.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ public function compressImage($sourceURL, $destinationURL, $minImgWidth, $wmImag
4242
// width to calculate positioning of the watermark.
4343
imagecopy($image, $watermark, imagesx($image) - $sx - $positionRight, imagesy($image) - $sy - $positionBottom, 0, 0, imagesx($watermark), imagesy($watermark));
4444

45+
imagecopyresampled($imgResource, $image, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);
46+
}elseif ($infoImg['mime'] == 'image/jpg'){
47+
$image = imagecreatefromjpeg($sourceURL);
48+
// Set the margins for the watermark and get the height/width of the watermark image
49+
$positionRight = $positionX;
50+
$positionBottom = $positionY;
51+
$sx = imagesx($watermark);
52+
$sy = imagesy($watermark);
53+
// width to calculate positioning of the watermark.
54+
imagecopy($image, $watermark, imagesx($image) - $sx - $positionRight, imagesy($image) - $sy - $positionBottom, 0, 0, imagesx($watermark), imagesy($watermark));
55+
4556
imagecopyresampled($imgResource, $image, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);
4657
} elseif ($infoImg['mime'] == 'image/png'){
4758
$image = imagecreatefrompng($sourceURL);

0 commit comments

Comments
 (0)