mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-16 13:08:01 +00:00
extended support for mp4 converted gifs so they can be used like normal mp4s
This commit is contained in:
@@ -51,6 +51,12 @@ If there is some option that's not recognized by PictShare it's simply ignored,
|
|||||||
forcesize | -none- | https://pictshare.net/100x400/forcesize/b260e36b60.jpg | 
|
forcesize | -none- | https://pictshare.net/100x400/forcesize/b260e36b60.jpg | 
|
||||||
**GIF to mp4** | | |
|
**GIF to mp4** | | |
|
||||||
mp4 | -none- | https://www.pictshare.net/mp4/102687fe65.gif | Converts gif to mp4 and displays as that. Note that you can't include that mp4 in an img tag
|
mp4 | -none- | https://www.pictshare.net/mp4/102687fe65.gif | Converts gif to mp4 and displays as that. Note that you can't include that mp4 in an img tag
|
||||||
|
raw | -none- | https://www.pictshare.net/mp4/raw/102687fe65.gif | Renders the converted mp4 directly. Use with /mp4/
|
||||||
|
preview | -none- | https://www.pictshare.net/mp4/preview/102687fe65.gif | Renders the first frame of generated MP4 as JPEG. Use with /mp4/
|
||||||
|
**MP4 options** | | |
|
||||||
|
-none- | -none- | https://www.pictshare.net/65714d22f0.mp4 | Renders the mp4 embedded in a simple HTML template. This link can't be embedded into video tags, use /raw/ instead if you want to embed
|
||||||
|
raw | -none- | https://www.pictshare.net/raw/65714d22f0.mp4 | Renders the mp4 video directly so you can link it
|
||||||
|
preview | -none- | https://www.pictshare.net/preview/65714d22f0.mp4 | Renders the first frame of the MP4 as an JPEG image
|
||||||
**Rotating** | | |
|
**Rotating** | | |
|
||||||
left | -none- | https://pictshare.net/left/b260e36b60.jpg | 
|
left | -none- | https://pictshare.net/left/b260e36b60.jpg | 
|
||||||
right | -none- | https://pictshare.net/right/b260e36b60.jpg | 
|
right | -none- | https://pictshare.net/right/b260e36b60.jpg | 
|
||||||
|
|||||||
14
inc/core.php
14
inc/core.php
@@ -152,6 +152,20 @@ function renderImage($data)
|
|||||||
case 'gif':
|
case 'gif':
|
||||||
if($data['mp4'])
|
if($data['mp4'])
|
||||||
{
|
{
|
||||||
|
$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);
|
renderMP4($pm->gifToMP4($path),$data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user