Marek TryliĆski
|
Tuesday 27 May 2008 6:08:15 am
hi i need to have an image class, that rotates images, do two layers, one in greyscale etc i made in php a proper function and i added it to standard image gd handler in lib directory how can i clear the kernel and move my code outside lib directory? i tried this: in image.ini
#[ImageConverterSettings]
#ExtensionList[]=ws_image
#ImageConverters[] #ImageConverters[]=WS
#[WS]
#Name=WS
#IsEnabled=true #Handler=ezimagegd can you help me? this is my function (that works in ez)
function przypinka( $imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData )
{
$polaroid=imagecreatefrompng('/var/plain_site/storage/polaroid.png');
$polaroidSzary=imagecreatefrompng('/var/plain_site/storage/polaroid.png');
$tlo=imagecreatefrompng('/var/plain_site/storage/tlo.png');
$tloBig=imagecreatefrompng('/var/plain_site/storage/tloBig.png');
$plaster=imagecreatefrompng('/var/plain_site/storage/plaster.png');
$tloKolor=imagecolorallocate($tlo,241,241,241);
$szary=$imageObject;
$kolor=$imageObject;
imagecopy($tlo, $polaroid, 24, 42, 0,0,252,237); //wkleja ramke na tlo
imagecopy($tlo, $szary, 34, 53, 0,0,229,213); //wkleja zdjecie swiadka do tla
$zastap = imagecolorallocate($tlo, 241, 241, 241);
imagecolortransparent($tlo,$zastap);
imagefilter($tlo,IMG_FILTER_GRAYSCALE);
$zastap = imagecolorallocate($tlo, 240, 240, 240);
imagecolortransparent($tlo,$zastap);
imagecopy($polaroid, $kolor, 10, 11, 0,0,229,213); //wkleja zdjecie swiadka do ramki
$polaroid=imagerotate($polaroid, 8,-1); // obreca ramke ze zdjeciem
$szer=ImageSX($polaroid); $wys=ImageSY($polaroid);//potrzebne bo obracanie zmienia rozmiar obrazka
imagecopy($tlo, $polaroid, 0, 9, 0,0,$szer,$wys); //wkleja obrocona ramke do tla
imagecopy($tlo, $plaster, 154, 10,0,0,120,90); //wkleja plasterek
imageantialias($tlo, true);
imagecopyresampled($tloBig,$tlo,0,0,0,0,560,560,280,280);
imagecopyresampled($tlo,$tloBig,0,0,0,0,280,280,560,560);
$tloSzare=imagecreatetruecolor(280,280);
$szarosc = imagecolorallocate($tloSzare, 248, 248, 248);
imagefill($tloSzare, 0, 0, $szarosc);
imagecopyresampled($tloSzare,$tlo,0,0,0,0,280,280,280,280);
return $tloSzare; }
--
http://trylik.pl/kategorie/ez-publish/
|