extended support for mp4 converted gifs so they can be used like normal mp4s

This commit is contained in:
Christian Haschek
2015-11-25 10:47:14 +01:00
parent 7b6332c41c
commit f40b3721ab
2 changed files with 22 additions and 2 deletions

View File

@@ -152,7 +152,21 @@ function renderImage($data)
case 'gif':
if($data['mp4'])
{
renderMP4($pm->gifToMP4($path),$data);
$mp4path = $path.'.mp4';
if($data['raw'])
{
serveFile($mp4path, 'gif/raw/'.$hash,'video/mp4');
}
else if($data['preview'])
{
$file = $mp4path.'.jpg';
if(!file_exists($file))
$pm->saveFirstFrameOfMP4($mp4path);
header ("Content-type: image/jpeg");
readfile($file);
}
else
renderMP4($pm->gifToMP4($path),$data);
}
else
{