1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-10 23:24:04 +02:00

Flextype Core: Glide/Intervention Image Implementation #61

This commit is contained in:
Awilum
2019-01-06 19:38:19 +03:00
parent 944a730eff
commit 955f2352fb

View File

@@ -218,7 +218,11 @@ class Images
*/
public static function getImageUrl($path, array $params)
{
return Http::getBaseUrl() . '/site/cache/glide/' . Images::$server->makeImage($path, $params);
if (file_exists(PATH['entries'] . $path)) {
return Http::getBaseUrl() . '/site/cache/glide/' . Images::$server->makeImage($path, $params);
} else {
return "File {$path} does not exist.";
}
}
/**
@@ -234,7 +238,11 @@ class Images
*/
public static function getImage($path, array $params, array $attributes = [])
{
return '<img '.Html::attributes($attributes).' src="'. Images::getImageUrl($path, $params) .'">';
if (file_exists(PATH['entries'] . $path)) {
return '<img '.Html::attributes($attributes).' src="'. Images::getImageUrl($path, $params) .'">';
} else {
return "File {$path} does not exist.";
}
}
/**