*/
class Photo extends BaseModule
{
-
/**
* @brief Module initializer
*
if ($photo === false) {
// not using System::httpExit() because we don't want html here.
header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found" , true, 404);
- killme();
+ exit();
}
$cacheable = ($photo["allow_cid"] . $photo["allow_gid"] . $photo["deny_cid"] . $photo["deny_gid"] === "") && (isset($photo["cacheable"]) ? $photo["cacheable"] : true);
System::httpExit(500, ["description" => "Invalid photo with id {$photo["id"]}."]);
}
-
// if customsize is set and image is not a gif, resize it
if ($img->getType() !== "image/gif" && $customsize > 0 && $customsize < 501) {
$img->scaleToSquare($customsize);
}
-
if (function_exists("header_remove")) {
header_remove("Pragma");
header_remove("pragma");
header("Cache-Control: max-age=31536000");
}
-
echo $img->asString();
-
- killme();
+ exit();
}
private static function stripExtension($name)