1
0
forked from metin2/web

Shop improvements, renamed "shop" to "mall", support for Argon2ID

This commit is contained in:
2024-06-02 22:09:52 +03:00
parent 83f4f72b6e
commit 63d0d2ac79
1932 changed files with 729 additions and 514 deletions

View File

@ -0,0 +1,23 @@
<?php
namespace App\Utils;
use GdImage;
class ImageHelpers
{
public static function imagecopymerge_alpha(GDImage $dst_im, GDImage $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h, int $pct): bool
{
// creating a cut resource
$cut = imagecreatetruecolor($src_w, $src_h);
// copying relevant section from background to the cut resource
imagecopy($cut, $dst_im, 0, 0, $dst_x, $dst_y, $src_w, $src_h);
// copying relevant section from watermark to the cut resource
imagecopy($cut, $src_im, 0, 0, $src_x, $src_y, $src_w, $src_h);
// insert cut resource to destination image
return imagecopymerge($dst_im, $cut, $dst_x, $dst_y, 0, 0, $src_w, $src_h, $pct);
}
}