rsemcs/dynmap/web/gettiles.php

23 lines
380 B
PHP
Raw Normal View History

2022-05-12 09:33:18 +00:00
<?php
define('TILESPATH', 'tiles/');
$path = $_SERVER['PATH_INFO'];
$fname = TILESPATH . $path;
if (!file_exists($fname)) {
$fname = "images/blank.png";
}
$fp = fopen($fname, 'rb');
if (strstr($path, ".png")) {
header("Content-Type: image/png");
} else {
header("Content-Type: image/jpeg");
}
header("Content-Length: " . filesize($fname));
fpassthru($fp);
exit;