Update Image.php

update for avi and mp3
This commit is contained in:
Florin-Ciprian Bodin
2023-08-31 18:37:56 +03:00
committed by GitHub
parent a20f96120f
commit d2ef9d437d

View File

@@ -233,6 +233,8 @@ class Image
{
$thumbnail_height = $this -> height;
$file = $this -> filename;
$file_icon = new Icon($file);
$this -> icon = $file_icon -> __toString();
if (!@is_file($file))
{
header('HTTP/1.0 404 Not Found');
@@ -292,9 +294,14 @@ class Image
break;
}
case 'avi' :
case 'mp4' :
case 'mpg' :
case 'mp3' :
case 'ogv' :
{
ini_set('memory_limit', '512M');
$src = function_exists('imagecreatefromavi') ? imagecreatefromavi($file) : imagecreatefromjpeg(str_replace('avi', 'jpg', $file));
$function = 'imagecreatefrom'.FileItem::ext($file);
$src = function_exists($function) ? $$function($file) : imagecreatefromjpeg(str_replace('avi', 'jpg', $file));
break;
}
case '3gp' :
@@ -423,4 +430,4 @@ class Image
}
}
?>
?>