-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtiling.php
executable file
·30 lines (24 loc) · 1.08 KB
/
tiling.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
include_once("utils.php");
include_once(CREATERGBARRAY);
echo "<!DOCTYPE html><html><style>" . openCSS() . "</style>";
// echo "<input type=\"range\" min=\"2\" max=\"50\" value=\"20\" class=\"slider\" id=\"size\">";
echo "<canvas><script>";
if (count($_GET) == 0) {
echo "\n</script>\n</canvas><form class = \"form\" \"form\" action=\"" . "tiling.php" . "\" method=\"get\">
Link to image: <input type=\"url\" name=\"url\"><br>
<input type=\"submit\" value=\"Submit\"></form>\n</canvas>\n</html>";
die();
}
$url = $_GET["url"];
$imageSizes = openIMAGESIZES();
$sizesJson = json_decode($imageSizes, true); //Move this to createRGBArray in the future
$skipSize = getBestSkip(getTotalPixels(getImageFromURL($url)), $sizesJson);
echo createRGBArray(getImageFromURL($url), $skipSize);
($pokemon = fopen("pokemon.data", "r")) or die("Unable to open file!");
($emoji = fopen("unicode/emoji.data", "r")) or die("Unable to open file!");
echo fread($pokemon, filesize("pokemon.data"));
echo fread($emoji, filesize("unicode/emoji.data"));
echo openJS();
echo "</script></canvas></html>";
?>