Click to See Complete Forum and Search --> : Creating PNG from Gif


Anon
06-12-2001, 12:38 PM
Hello

Is it possible to use:

ImageCreateFromGIF(..) function then output a .png using

ImagePng(..)

My example is as follows:

Header("Content-type: image/png");
$RStrLen=strlen($R);
$CStrLen=strlen($C."F");
$img=ImageCreateFromGIF("images/cir_plp.gif");


$ImgHeight=ImageSY($img)-30;
$ImgWidth=ImageSX($img)-35;

$RFontWidth=$RStrLen*ImageFontWidth(3);
$CFontWidth=$CStrLen*ImageFontWidth(3);

$CFontLeft=($ImgWidth-$CFontWidth)-5;
$RFontLeft=($ImgWidth-$RFontWidth)/2;

$CFontTop=($ImgHeight/2)+7;
$RFontTop=20;

ImageString($img,3,$CFontLeft,$CFontTop,$C." F",0);
ImageString($img,3,$RFontLeft,$RFontTop,$R."ohm",0);
ImagePng($img);
ImageDestroy($img);

vincente
06-12-2001, 12:57 PM
Yes it's possible, provided your GD library supports GIF and PNG ofcourse.