Initial commit
This commit is contained in:
21
Creative/dynmap/web/gettiles.php
Normal file
21
Creative/dynmap/web/gettiles.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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;
|
||||
?>
|
Reference in New Issue
Block a user