function extract_ico($file)
{
 include('pclzip.php');$zip = new PclZip($file);
 $c = $zip->extract(PCLZIP_OPT_BY_NAME, "META-INF/MANIFEST.MF", PCLZIP_OPT_EXTRACT_AS_STRING);
 $c = $c[0]['content'];
 if (preg_match('|MIDlet-Icon:[^a-z]*?(.*png)|Uis', $c, $match))
 {
 $iconf = trim($match[1]);
 $yesicon = 1;
 }
 elseif (preg_match('|MIDlet-1:[^,]*,[^a-z]*?(.*png),|Uis', $c, $match2))
 {
 $iconf = trim($match2[1]);
 $yesicon = 1;
 }
 else
 {
 $yesicon = 0;
 }
 if ($yesicon)
 {
 header('Content-type:image/png');
 $img = $zip->extract(PCLZIP_OPT_BY_NAME,$iconf, PCLZIP_OPT_EXTRACT_IN_OUTPUT);
 ImageDestroy($img);
 }
 else
 {
 header('Content-type:image/png');
 $img = imagecreatefrompng ("jar.png");
 imagepng($img);
 ImageDestroy($img);
 }
}

Скачать скрипт

You must be logged in to leave a reply.