1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00

Improve roku image

This commit is contained in:
Daniel Neto 2023-05-03 14:15:25 -03:00
parent db1e8f5478
commit 776f47a1df

View file

@ -31,6 +31,23 @@ if (preg_match('/videos\/(.*\/)?(.*)_thumbs(V2)?.jpg/', $imageURL, $matches) &&
readfile($file);
exit;
}
}else if (preg_match('/videos\/(.*\/)?(.*)_roku.jpg/', $imageURL, $matches) && !empty($matches[2])) {
$jpg = Video::getPathToFile("{$matches[2]}.jpg");
if (file_exists($jpg)) {
$file = $jpg;
if (preg_match('/_roku/', $imageURL)) {
_error_log("3 Image not found for {$imageURL} converting $jpg,{$global['systemRootPath']}{$imageURL} => Width = ".($advancedCustom->thumbsWidthPortrait / 2).", Height=".($advancedCustom->thumbsHeightPortrait/2));
convertImageIfNotExists($jpg, $global['systemRootPath'] . $imageURL, $advancedCustom->thumbsWidthPortrait / 2, $advancedCustom->thumbsHeightPortrait / 2, true);
} else {
_error_log("4 Image not found for {$imageURL} we are using {$jpg} instead ");
}
$type = 'image/jpg';
//header("HTTP/1.0 404 Not Found");
header('Content-Type:' . $type);
header('Content-Length: ' . filesize($file));
readfile($file);
exit;
}
}
if (empty($_GET['notFound'])) {