Fix missing favicon

Update default favicon
This commit is contained in:
Knah Tsaeb 2024-03-20 10:33:35 +01:00
parent 8276923634
commit 02830caae3
2 changed files with 3 additions and 4 deletions

View file

@ -33,18 +33,18 @@ class GetFav extends GetThumb {
if (!is_null($info->favicon)) {
if (!$favicon = @file_get_contents($info->favicon)) {
copy(__DIR__ . '/../../src/images/error_fav.' . $this->fileFormat, $this->demande->requestImg);
copy(__DIR__ . '/../../src/images/error_fav.png', $this->demande->requestImg);
$this->db->addUpdate(2, $this->type);
return true;
}
} elseif (!is_null($info->icon)) {
if (!$favicon = @file_get_contents($info->icon)) {
copy(__DIR__ . '/../../src/images/error_fav.' . $this->fileFormat, $this->demande->requestImg);
copy(__DIR__ . '/../../src/images/error_fav.png', $this->demande->requestImg);
$this->db->addUpdate(2, $this->type);
return true;
}
} else {
copy(__DIR__ . '/../../src/images/error_fav.' . $this->fileFormat, $this->demande->requestImg);
copy(__DIR__ . '/../../src/images/error_fav.png', $this->demande->requestImg);
$this->db->addUpdate(2, $this->type);
return true;
}
@ -95,7 +95,6 @@ class GetFav extends GetThumb {
if (!file_exists($this->requestImg) && $this->type === 'fav') {
$this->makeFavicon();
}
//echo '<img src="data:image/png;base64,'.base64_encode(file_get_contents($this->requestImg)).'">';
header("Content-type: image/$this->fileFormat");
header('Expires: ', gmdate('D, d M Y H:i:s', time()) . ' GMT');
echo file_get_contents($this->requestImg);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB