mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-19 22:47:59 +00:00
Unified docker building process. & more updates
- automatic builds - automated tags on docker - no more auto update (update your docker containers) - auto not removed of mp4 anymore - bug fixes also closes #85 and closes #124
This commit is contained in:
@@ -155,7 +155,7 @@ class ImageController implements ContentController
|
||||
|
||||
header ("Content-type: image/jpeg");
|
||||
readfile($preview);
|
||||
|
||||
exit;
|
||||
}
|
||||
else if(in_array('download',$url))
|
||||
{
|
||||
@@ -175,6 +175,7 @@ class ImageController implements ContentController
|
||||
{
|
||||
$data = array('url'=>implode('/',$url),'hash'=>$hash,'filesize'=>renderSize(filesize($path)));
|
||||
renderTemplate('video',$data);
|
||||
exit;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -194,6 +195,7 @@ class ImageController implements ContentController
|
||||
header ("Content-type: image/jpeg");
|
||||
header ("Last-Modified: ".gmdate('D, d M Y H:i:s ', filemtime($path)) . 'GMT');
|
||||
header ("ETag: $hash");
|
||||
header('Cache-control: public, max-age=31536000');
|
||||
readfile($path);
|
||||
break;
|
||||
|
||||
@@ -201,6 +203,7 @@ class ImageController implements ContentController
|
||||
header ("Content-type: image/png");
|
||||
header ("Last-Modified: ".gmdate('D, d M Y H:i:s ', filemtime($path)) . 'GMT');
|
||||
header ("ETag: $hash");
|
||||
header('Cache-control: public, max-age=31536000');
|
||||
readfile($path);
|
||||
break;
|
||||
|
||||
@@ -208,6 +211,7 @@ class ImageController implements ContentController
|
||||
header ("Content-type: image/gif");
|
||||
header ("Last-Modified: ".gmdate('D, d M Y H:i:s ', filemtime($path)) . 'GMT');
|
||||
header ("ETag: $hash");
|
||||
header('Cache-control: public, max-age=31536000');
|
||||
readfile($path);
|
||||
break;
|
||||
|
||||
@@ -215,6 +219,7 @@ class ImageController implements ContentController
|
||||
header ("Content-type: image/webp");
|
||||
header ("Last-Modified: ".gmdate('D, d M Y H:i:s ', filemtime($path)) . 'GMT');
|
||||
header ("ETag: $hash");
|
||||
header('Cache-control: public, max-age=31536000');
|
||||
readfile($path);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ class VideoController implements ContentController
|
||||
return array('status'=>'err','hash'=>$hash,'reason'=>'Custom hash already exists');
|
||||
}
|
||||
|
||||
storeFile($tmpfile,$hash,true);
|
||||
$file = storeFile($tmpfile,$hash,true);
|
||||
|
||||
if(!$this->rightEncodedMP4($file))
|
||||
system("nohup php ".ROOT.DS.'tools'.DS.'re-encode_mp4.php force '.$hash." > /dev/null 2> /dev/null &");
|
||||
@@ -91,6 +91,7 @@ class VideoController implements ContentController
|
||||
$start = 0;
|
||||
$end = $size - 1;
|
||||
header('Content-type: video/mp4');
|
||||
header('Cache-control: public, max-age=31536000');
|
||||
header("Accept-Ranges: 0-$length");
|
||||
if (isset($_SERVER['HTTP_RANGE'])) {
|
||||
$c_start = $start;
|
||||
|
||||
Reference in New Issue
Block a user