1
0
This repository has been archived on 2021-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
gallery3-contrib/icons/depricated/filmStrip.php
2011-05-24 13:28:35 +02:00

64 lines
1.2 KiB
PHP

<?
$src = array (
"rounded_black.png",
"rounded_dkgrey.png",
"rounded_ltgrey.png",
"rounded_white.png"
);
$under = 0; // combine images underneath or not?
// -- end of config
$imgBuf = array ();
$maxW=0; $maxH=0;
foreach ($src as $link)
{
switch(substr ($link,strrpos ($link,".")+1))
{
case 'png':
$iTmp = imagecreatefrompng($link);
break;
case 'gif':
$iTmp = imagecreatefromgif($link);
break;
case 'jpeg':
case 'jpg':
$iTmp = imagecreatefromjpeg($link);
break;
}
if ($under)
{
$maxW=(imagesx($iTmp)>$maxW)?imagesx($iTmp):$maxW;
$maxH+=imagesy($iTmp);
}
else
{
$maxW+=imagesx($iTmp);
$maxH=(imagesy($iTmp)>$maxH)?imagesy($iTmp):$maxH;
}
array_push ($imgBuf,$iTmp);
}
$iOut = imagecreatetruecolor ($maxW,$maxH) ;
$iOut = imagecreate ($maxW,$maxH) ;
$pos=0;
foreach ($imgBuf as $img)
{
if ($under)
imagecopy ($iOut,$img,0,$pos,0,0,imagesx($img),imagesy($img));
else
imagecopy ($iOut,$img,$pos,0,0,0,imagesx($img),imagesy($img));
$pos+= $under ? imagesy($img) : imagesx($img);
imagedestroy ($img);
}
//header("Content-type: image/jpg");
imagealphablending($iOut, true);
imagesavealpha($iOut, true);
imagepng($iOut);
?>