mirror of https://github.com/YGGverse/YGGo.git
phpyggdrasilcrawlermysqljs-lessalt-websphinxspideropen-sourcedistributedwebsearch-enginefts5privacy-orientedsphinxsearchfederativeweb-archivepdocurlparser
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
823 B
37 lines
823 B
2 years ago
|
<?php
|
||
|
|
||
|
require_once('../config/app.php');
|
||
|
require_once('../library/icon.php');
|
||
|
|
||
|
if (isset($_GET['q'])) {
|
||
|
|
||
|
$hash = md5($_GET['q']);
|
||
|
|
||
|
$width = isset($_GET['width']) ? (int) $_GET['width'] : 16;
|
||
|
$height = isset($_GET['height']) ? (int) $_GET['height'] : 16;
|
||
|
|
||
|
$radius = isset($_GET['radius']) ? (int) $_GET['radius'] : 0;
|
||
|
|
||
|
header("Content-Type: image/webp");
|
||
|
|
||
|
if (WEBSITE_IDENTICON_IMAGE_CACHE) {
|
||
|
|
||
|
$filename = dirname(__FILE__) . '/../storage/cache/' . $hash . '.png';
|
||
|
|
||
|
if (!file_exists($filename)) {
|
||
|
|
||
|
$icon = new Icon();
|
||
|
|
||
|
file_put_contents($filename, $icon->generateImageResource($hash, $width, $height, false, $radius));
|
||
|
}
|
||
|
|
||
|
echo file_get_contents($filename);
|
||
|
|
||
|
} else {
|
||
|
|
||
|
$icon = new Icon();
|
||
|
|
||
|
echo $icon->generateImageResource($hash, $width, $height, false, $radius);
|
||
|
}
|
||
|
}
|