php separate
This commit is contained in:
37
php/mp4.php
Normal file
37
php/mp4.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/common.php';
|
||||
|
||||
// This service expects POST data with specific parameters
|
||||
$elements = $_POST['data'];
|
||||
$numimages = $_POST['images'];
|
||||
$delay = $_POST['delay'];
|
||||
$lastdelay = $_POST['lastdelay'];
|
||||
$maxh = $_POST['maxh'];
|
||||
$maxv = $_POST['maxv'];
|
||||
|
||||
if (! is_numeric($maxh)) {
|
||||
$maxh = 500;
|
||||
}
|
||||
|
||||
if (! is_numeric($maxv)) {
|
||||
$maxv = 400;
|
||||
}
|
||||
|
||||
$numimages = $numimages - 1;
|
||||
|
||||
$inputfiles = "";
|
||||
|
||||
foreach ($elements as $value) {
|
||||
if ($value != $elements[array_key_last($elements)]) {
|
||||
$inputfiles = $inputfiles . " -delay {$delay} {$value}";
|
||||
}
|
||||
if ($value == $elements[array_key_last($elements)]) {
|
||||
$inputfiles = $inputfiles . " -delay {$lastdelay} {$value}";
|
||||
}
|
||||
}
|
||||
|
||||
$gif = shell_exec("convert {$inputfiles} -resize {$maxh}x{$maxv}\> -layers Optimize gif:-");
|
||||
|
||||
echo base64_encode($gif);
|
||||
exit;
|
||||
?>
|
||||
Reference in New Issue
Block a user