added watermark settings tab on the branding page and added more package details to the billing page, added a new guest notifications page
This commit is contained in:
@@ -33,6 +33,7 @@ class ImageHelper
|
||||
$h = imagesy($src);
|
||||
if ($w === 0 || $h === 0) {
|
||||
imagedestroy($src);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -138,18 +139,44 @@ class ImageHelper
|
||||
$x = $padding;
|
||||
$y = $padding;
|
||||
|
||||
if ($position === 'top-right') {
|
||||
$x = max(0, $srcW - $targetW - $padding);
|
||||
} elseif ($position === 'bottom-left') {
|
||||
$y = max(0, $srcH - $targetH - $padding);
|
||||
} elseif ($position === 'bottom-right') {
|
||||
$x = max(0, $srcW - $targetW - $padding);
|
||||
$y = max(0, $srcH - $targetH - $padding);
|
||||
} elseif ($position === 'center') {
|
||||
$x = (int) max(0, ($srcW - $targetW) / 2);
|
||||
$y = (int) max(0, ($srcH - $targetH) / 2);
|
||||
switch ($position) {
|
||||
case 'top-right':
|
||||
$x = max(0, $srcW - $targetW - $padding);
|
||||
break;
|
||||
case 'top-center':
|
||||
$x = (int) max(0, ($srcW - $targetW) / 2);
|
||||
break;
|
||||
case 'middle-left':
|
||||
$y = (int) max(0, ($srcH - $targetH) / 2);
|
||||
break;
|
||||
case 'center':
|
||||
$x = (int) max(0, ($srcW - $targetW) / 2);
|
||||
$y = (int) max(0, ($srcH - $targetH) / 2);
|
||||
break;
|
||||
case 'middle-right':
|
||||
$x = max(0, $srcW - $targetW - $padding);
|
||||
$y = (int) max(0, ($srcH - $targetH) / 2);
|
||||
break;
|
||||
case 'bottom-left':
|
||||
$y = max(0, $srcH - $targetH - $padding);
|
||||
break;
|
||||
case 'bottom-center':
|
||||
$x = (int) max(0, ($srcW - $targetW) / 2);
|
||||
$y = max(0, $srcH - $targetH - $padding);
|
||||
break;
|
||||
case 'bottom-right':
|
||||
$x = max(0, $srcW - $targetW - $padding);
|
||||
$y = max(0, $srcH - $targetH - $padding);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
$offsetX = (int) ($config['offset_x'] ?? 0);
|
||||
$offsetY = (int) ($config['offset_y'] ?? 0);
|
||||
$x = max(0, min($srcW - $targetW, $x + $offsetX));
|
||||
$y = max(0, min($srcH - $targetH, $y + $offsetY));
|
||||
|
||||
$opacity = max(0.0, min(1.0, (float) ($config['opacity'] ?? 0.25)));
|
||||
$mergeOpacity = (int) round($opacity * 100); // imagecopymerge uses 0-100
|
||||
|
||||
|
||||
Reference in New Issue
Block a user