-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbimage.php
More file actions
24 lines (23 loc) · 897 Bytes
/
dbimage.php
File metadata and controls
24 lines (23 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
require "com/scorchedcode/companions/companionfactory.php";
require "com/scorchedcode/mounts/mountfactory.php";
require "com/scorchedcode/artifacts/artifactfactory.php";
if(isset($_GET["name"]) && isset($_GET["type"])) {
header('Content-Type: image/png');
if(strcasecmp($_GET["type"], "comp") == 0) {
$type = (new CompanionFactory())->getCompanion($_GET["name"]);
}
else if(strcasecmp($_GET["type"], "mount") == 0) {
$type = (new MountFactory())->getMount($_GET["name"]);
}
else if(strcasecmp($_GET["type"], "art") == 0) {
$type = (new ArtifactFactory())->getArtifact($_GET["name"], "Uncommon");
}
$im = imagecreatefromstring(base64_decode(str_replace("data:image/png;base64, ", "", $type->getPicture())));
imagepng($im);
imagedestroy($im);
}
else {
echo "Not found.";
}
?>