function gump($id, $hue) { include "gumpart.php"; if ($id[0] == 0) { $id = hexdec($id); } if ($hue[0] == 0) { $hue = hexdec($hue); } $file = "images/gumpart/gumpart_" . $id . "_" . $hue . ".png"; if (!file_exists($file)) { creategumpart($id, $hue, 0); } echo "<img src=\"{$file}\">"; }
if ($id[0] == 0) { $id = hexdec($id); } else { $id = intval($id); } if (!isset($_GET["hue"])) { $hue = 0; } else { $hue = $_GET["hue"]; if ($hue[0] == 0) { $hue = hexdec($hue); } else { $hue = intval($hue); } } creategumpart($id, $hue, 1); exit; } function creategumpart($index, $hue, $show) { if (file_exists("images/gumpart/gumpart_" . $index . "_" . $hue . ".png")) { if ($show == 1) { Header("Content-type: image/png"); header("Content-disposition: inline; filename=gumpart_" . $index . "_" . $hue . ".png"); $img = imagecreatefrompng("images/gumpart/gumpart_" . $index . "_" . $hue . ".png"); $black = imagecolorallocate($img, 0, 0, 0); imagecolortransparent($img, $black); imagepng($img); return; } }