extract(PCLZIP_OPT_BY_NAME, "META-INF/MANIFEST.MF" ,PCLZIP_OPT_EXTRACT_AS_STRING); if (ereg("MIDlet-Icon: ",$content[0]['content'])) { $jad=explode("MIDlet-Icon: ",$content[0]['content']); $icon=str_replace("\n"," ", $jad[1]); $icon=str_replace("\r"," ", $icon); $icon=strtok($icon,' '); $icon=ereg_replace("^/","", $icon); } else { $jad=explode(",",$content[0]['content']); $icon=str_replace("\n"," ", $jad[1]); $icon=str_replace("\r"," ", $icon); $icon=strtok($icon,' '); $icon=ereg_replace("^/","", $icon); } $file=str_replace('/','_',$file); $content = $zip->extract(PCLZIP_OPT_BY_NAME, "$icon",PCLZIP_OPT_EXTRACT_AS_STRING); if (!isset($content[0]['content']) || $content[0]['content']=='')exit; $j=fopen("java_scr/".$file.".png", 'w'); fwrite($j, $content[0]['content']); fclose($j); @chmod("java_scr/".$file.".png", 0777); $size = GetImageSize($file.".png"); $width = $size[0]; $height = $size[1]; $x_ratio = 16 / $width; $y_ratio = 16 / $height; if ( ($width <= 16) && ($height <= 16) ){$tn_width = $width; $tn_height = $height; } else if (($x_ratio * $height) < 16) { $tn_height = ceil($x_ratio * $height); $tn_width = 16; } else {$tn_width = ceil($y_ratio * $width); $tn_height = 16;} $src = ImageCreateFromPng($file.".png"); $dst = ImageCreate($tn_width,$tn_height); ImageCopyResized($dst, $src, 0, 0, 0, 0, $tn_width,$tn_height,$width,$height); imagecolortransparent($dst, '0'); header("Content-type: image/png"); if ($width>16 || $height>16) { ImagePng ($dst, 'java_scr/'.$file.'.png'); ImagePng ($dst); } else { ImagePng ($src, 'java_scr/'.$file.'.png'); ImagePng ($src); } //unlink("temp/$sess.png"); ?>