<?php
$cacheFolder = 'cache';
header("Content-type: image/png");
$name = $_GET['name'];
$size = $_GET['size'] > 0 ? $_GET['size'] : 100;
if(isset($_GET['cache'])){
}
$cachePath = $cacheFolder . DIRECTORY_SEPARATOR . $name . '_' . $time . '_' . $size . '.png';
$file = $name. '_'. $time . '_' . $size . '.png';
chmod($file,0777);
$cachePathOld = $cacheFolder . DIRECTORY_SEPARATOR . $name . '_' . $old . '_' . $size . '.png';
$lol = $cachePath;
$lol2 = $lol1[1];
$lol4 = $lol3[0];
$lol6 = $lol5[1];
if ($lol6 >= date("d")) { return true;
}
else {
include($cachePath);
}
}
}
$src = imagecreatefrompng("http://minecraft.net/skin/{$name}.png");
if(!$src){
$src = imagecreatefrompng("http://www.minecraft.net/skin/char.png");
}
$dest = imagecreatetruecolor(8, 8);
$obraz = imagecopy($dest, $src, 0, 0, 8, 8, 8, 8); // copy the face
$obraz1 = imagecopy($dest, $src, 0, 0, 40, 8, 8, 8);
imagedestroy($obraz1);
$final = imagecreatetruecolor($size, $size);
imagecopyresized($final, $dest, 0, 0, 0, 0, $size, $size, 8, 8);
if(isset($_GET['cache'])){
imagepng($final, $cachePath);
include($cachePath);
}
else {
imagepng($final);
}
imagedestroy($im);
imagedestroy($dest);
imagedestroy($final);
?>
Na xampp działa, na linuxie nie c: