Put simpleParallax and modify logo.php to merge

This commit is contained in:
2020-01-04 18:18:39 +01:00
parent ca6e77ebb0
commit fc231ee294
69 changed files with 3660 additions and 23 deletions

View File

@@ -4,26 +4,53 @@ $alea=rand(0,100);
$logo='topisto_vert_tr.png';
if ($alea > 5)
$block_image = @imagecreatefrompng($logo);
$width = imagesx($block_image);
$height = imagesy($block_image);
// create the destination/output image.
$img=imagecreatetruecolor( $width, $height );
// enable alpha blending on the destination image.
imagealphablending($img, true);
// Allocate a transparent color and fill the new image with it.
// Without this the image will have a black background instead of being transparent.
$transparent = imagecolorallocatealpha( $img, 255, 255, 255, 127 );
imagefill( $img, 0, 0, $transparent );
// copy the thumbnail into the output image.
imagecopyresampled($img,$block_image, 0, 0, 0, 0, $width, $height, $width, $height );
imagedestroy($block_image);
if ($alea < 1000)
{
$files = glob('logo/medium/*/topisto_vert.png');
$files = glob('logo/tr/topisto_*.png');
usort($files, function($a, $b) {
return filemtime($a) > filemtime($b);
});
shuffle($files);
$logo = $files[0];
$superpose = @imagecreatefrompng($files[0]);
//imagecopymerge($img, $superpose, 0, 0, 0, 0, $width, $height, 50);
imagecopyresampled($img,$superpose, 0, 0, 0, 0, $width, $height, imagesx($superpose), imagesy($superpose));
imagedestroy($superpose);
}
$block_image = @imagecreatefrompng($logo);
imagealphablending($img, false);
imagesavealpha($img,true);
// ---
// --- envoyer l'image au navigateur
// ---
header("Content-Type: image/png");
imagepng($block_image);
imagepng($img);
imagedestroy($block_image);
imagedestroy($img);
?>