mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-16 13:08:01 +00:00
preview images of mp4 from gifs are now working again
This commit is contained in:
17
inc/core.php
17
inc/core.php
@@ -150,12 +150,13 @@ function renderImage($data)
|
|||||||
imagepng($im);
|
imagepng($im);
|
||||||
break;
|
break;
|
||||||
case 'gif':
|
case 'gif':
|
||||||
if($data['mp4'])
|
if($data['mp4']) //user wants mp4
|
||||||
{
|
{
|
||||||
$mp4path = $cachepath;
|
$gifpath = $path;
|
||||||
|
$mp4path = $base_path.'mp4_1.'.$hash; //workaround.. find a better solution!
|
||||||
|
|
||||||
if(!file_exists($mp4path)) //if mp4 does not exist, create it
|
if(!file_exists($mp4path) && !$data['preview']) //if mp4 does not exist, create it
|
||||||
$pm->gifToMP4($path,$mp4path);
|
$pm->gifToMP4($gifpath,$mp4path);
|
||||||
|
|
||||||
if($data['raw'])
|
if($data['raw'])
|
||||||
{
|
{
|
||||||
@@ -164,15 +165,15 @@ function renderImage($data)
|
|||||||
else if($data['preview'])
|
else if($data['preview'])
|
||||||
{
|
{
|
||||||
$file = $mp4path;
|
$file = $mp4path;
|
||||||
if(!file_exists($file))
|
if(!file_exists($cachepath))
|
||||||
$pm->saveFirstFrameOfMP4($mp4path,$path);
|
$pm->saveFirstFrameOfMP4($mp4path,$cachepath);
|
||||||
header ("Content-type: image/jpeg");
|
header ("Content-type: image/jpeg");
|
||||||
readfile($file);
|
readfile($cachepath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
renderMP4($mp4path,$data);
|
renderMP4($mp4path,$data);
|
||||||
}
|
}
|
||||||
else
|
else //user wants gif
|
||||||
{
|
{
|
||||||
header ("Content-type: image/gif");
|
header ("Content-type: image/gif");
|
||||||
readfile($path);
|
readfile($path);
|
||||||
|
|||||||
Reference in New Issue
Block a user