$nomanage = true; } $imtype = "png"; $outype = "png"; break; default: echo ErrorPNG("wrong img type"); exit; } $ratio = floatval($img[0] / $w); $h = ceil($img[1] / $ratio); } else { echo ErrorPNG("not image type"); exit; } } else { $nomanage = true; $img = getimagesize($fromfile); } if ($nomanage) { ErrorPNG("image type not supported"); exit; } $ou = imagecreatetruecolor($w, $h); imagealphablending($ou, false); $funcall = "imagecreatefrom{$imtype}"; imagecopyresampled($ou, $funcall($fromfile), 0, 0, 0, 0, $w, $h, $img[0], $img[1]); $funcall = "image{$outype}"; $funcall($ou, "uploaded/cache/" . md5($_SERVER['QUERY_STRING'])); header("Content-type: " . $img['mime']); $funcall($ou);
exit; } // check image orientation if ($img[0] < $img[1]) { $h = $w; $ratio = floatval($img[1] / $h); $w = ceil($img[0] / $ratio); } else { $ratio = floatval($img[0] / $w); $h = ceil($img[1] / $ratio); } } else { ErrorPNG($ERR_710); exit; } } else { $nomanage = true; } if ($nomanage) { ErrorPNG($ERR_710); exit; } $ou = imagecreatetruecolor($w, $h); imagealphablending($ou, false); $funcall = "imagecreatefrom{$imtype}"; imagecopyresampled($ou, $funcall($fromfile), 0, 0, 0, 0, $w, $h, $img[0], $img[1]); $funcall = "image{$outype}"; $funcall($ou, $upload_path . 'cache/' . $_w . '-' . md5($fromfile)); header('Content-type: ' . $img['mime']); $funcall($ou); }
exit; } // check image orientation if ($img[0] < $img[1]) { $h = $w; $ratio = floatval($img[1] / $h); $w = ceil($img[0] / $ratio); } else { $ratio = floatval($img[0] / $w); $h = ceil($img[1] / $ratio); } } else { ErrorPNG('not image type'); exit; } } else { $nomanage = true; } if ($nomanage) { ErrorPNG('image type not supported'); exit; } $ou = imagecreatetruecolor($w, $h); imagealphablending($ou, false); $funcall = "imagecreatefrom{$imtype}"; imagecopyresampled($ou, $funcall($fromfile), 0, 0, 0, 0, $w, $h, $img[0], $img[1]); $funcall = "image{$outype}"; $funcall($ou, $upload_path . 'cache/' . $_w . '-' . md5($fromfile)); header('Content-type: ' . $img['mime']); $funcall($ou); }