viewing paste Image Conversion | PHP

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
for($counted=0; $counted < $countlines; $counted++) {
$resname[$incodd]=utf8_decode($resname[$incodd]);
    if(file_exists('item/original/'.$resname[$incodd].'.bmp')){
        $imgname = 'item/original/'.$resname[$incodd].'.bmp';
        $im = imagecreatefrombmp($imgname);
        $background_color = imagecolorallocate($im, 255, 0, 255);
        imagecolortransparent($im, $background_color);
        $remove = array("\n", "\r\n", "\r");
        $resname[$inceven] = str_replace($remove,'',$resname[$inceven]);
        imagepng($im, 'item/png/'.$resname[$inceven].'.png');
        imagedestroy($im);
        $countconverted++;
        
        $displayoutput.='<img src="item/original/'.$resname[$incodd].'.bmp"> ('.$resname[$incodd].'.bmp) -> <img src="item/png/'.$resname[$inceven].'.png"> ('.$resname[$inceven].'.png)<br />';
    } else {
        $displayoutput.=$resname[$incodd].'.bmp doesn\'t exist<br />';
    }
    $incodd=$incodd+2;
    $inceven=$inceven+2;
}
Viewed 1166 times, submitted by Akkarin.