fix: add PHP version compare for blurhash image

This commit is contained in:
vnmedeiros 2021-02-18 10:00:26 -03:00
parent 946d5b27a9
commit 2ad1489d99
1 changed files with 4 additions and 1 deletions

View File

@ -145,7 +145,10 @@ class Item extends Entity {
}
private function get_image_blurhash($file_path, $width, $height) {
if (!$image = @imagecreatefromstring(file_get_contents($file_path))) {
if (
!(version_compare(PHP_VERSION, '7.2.0') >= 0) ||
!$image = @imagecreatefromstring(file_get_contents($file_path))
) {
return "V4P?:h00Rj~qM{of%MRjWBRjD%%MRjayofj[%M-;RjRj";
}
if($image == false)