function renderNocacheTms() { global $img, $i3georendermode, $dir_tmp, $cortePixels; if ($i3georendermode == 1 && $cortePixels == 0) { ob_clean(); header('Content-Type: image/png'); $img->saveImage(); exit; } if ($i3georendermode == 1 && $cortePixels > 0) { $i3georendermode = 0; } $nomer = $dir_tmp . "/temp" . nomeRand() . ".png"; $img->saveImage($nomer); // //corta a imagem gerada para voltar ao tamanho normal // if ($cortePixels > 0) { $img = imagecreatefrompng($nomer); $imgc = imagecreate(256, 256); imagecopy($imgc, $img, 0, 0, $cortePixels, $cortePixels, 256, 256); imagepng($imgc, $nomer); } if ($i3georendermode == 0 || !isset($i3georendermode)) { header('Content-Length: ' . filesize($nomer)); header('Content-Type: image/png'); header('Cache-Control: max-age=3600, must-revalidate'); header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 24 * 60 * 60) . ' GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($nomer)) . ' GMT', true, 200); //fpassthru(fopen($nomer, 'rb')); $nomer = str_replace(".png", "", $nome) . ".png"; readfile($nomer); } if ($i3georendermode == 2) { ob_clean(); header('Cache-Control: public, max-age=22222222'); header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 48 * 60 * 60) . ' GMT'); header("X-Sendfile: {$nomer}"); header("Content-type: image/png"); } }
imagealphablending($img, false); imagesavealpha($img, true); } ob_clean(); echo header("Content-type: image/png \n\n"); imagepng($img); imagedestroy($img); exit; } if ($_SESSION["i3georendermode"] == 1) { ob_clean(); header('Content-Type: image/png'); $img->saveImage(); } if ($_SESSION["i3georendermode"] == 2) { $nomer = $img->imagepath . "temp" . nomeRand() . ".png"; $img->saveImage($nomer); // //corta a imagem gerada para voltar ao tamanho normal // if ($cortePixels > 0) { $img = cortaImagemDisco($nomer, $cortePixels, 256); } ob_clean(); header('Cache-Control: public, max-age=22222222'); header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 48 * 60 * 60) . ' GMT'); header("X-Sendfile: {$nomer}"); header("Content-type: image/png"); } } exit;