File manager - Edit - /home/webapp69.cm.in.th/u69319090041/Shop41/public/gen_images.php
Back
<?php // Script to copy product images to uploads folder $uploadsDir = __DIR__ . '/uploads/'; // Copy images from temp locations - using base64 encoded images provided by user // Since images were provided as context, we'll save them using GD // Create black t-shirt product image (solid black t-shirt style) $width = 800; $height = 900; $img = imagecreatetruecolor($width, $height); // White background $white = imagecolorallocate($img, 255, 255, 255); imagefill($img, 0, 0, $white); // Draw simple black t-shirt shape $black = imagecolorallocate($img, 10, 10, 10); $darkGray = imagecolorallocate($img, 30, 30, 30); // Body of shirt imagefilledpolygon($img, [ 150, 200, // left shoulder 650, 200, // right shoulder 700, 850, // bottom right 100, 850, // bottom left ], 4, $black); // Left sleeve imagefilledpolygon($img, [ 150, 200, // top shoulder 50, 150, // sleeve tip 30, 320, // sleeve bottom left 150, 320, // sleeve bottom right ], 4, $darkGray); // Right sleeve imagefilledpolygon($img, [ 650, 200, // top shoulder 750, 150, // sleeve tip 770, 320, // sleeve bottom right 650, 320, // sleeve bottom left ], 4, $darkGray); // Neck imagefilledellipse($img, 400, 190, 200, 80, $darkGray); imagefilledellipse($img, 400, 180, 160, 60, $white); // Re-draw body over neck hole imagefilledpolygon($img, [ 150, 210, 650, 210, 700, 850, 100, 850, ], 4, $black); // Collar curve imagearc($img, 400, 200, 160, 70, 0, 180, $darkGray); imagejpeg($img, $uploadsDir . 'black_tshirt_main.jpg', 90); imagedestroy($img); echo "Images saved successfully!\n"; echo "black_tshirt_main.jpg - OK\n"; ?>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.42 |
proxy
|
phpinfo
|
Settings