diff --git a/src/index.php b/src/index.php
index 3705083..1198bd8 100644
--- a/src/index.php
+++ b/src/index.php
@@ -1,215 +1,252 @@
+
+ wrong parameter :
+ "
"
+
+
+
+
+ File not found:
+ "
"
+
+
+ ';
+ return '';
+ return '';
}
- if (isset($_GET["img"])) {
- if (ereg('[^-_.A-Za-z0-9]', $_GET["img"])) {
-?>
-
-Illegal Image name: "
"
-
-
-
-
-Image not found: "
"
-
-
-
-
-Illegal Video name: "
"
-
-
-/dev/null');
- break;
- case "mp4":
- header('Content-type: video/mp4');
- exec('ffmpeg -i "'.$DIR.'/'.$_GET["video"].'" -qscale 4 -vcodec libx264 -f mp4 - 2>/dev/null');
- break;
- }
- } else { */
-// Clears the cache and prevent unwanted output
-ob_clean();
-@ini_set('error_reporting', E_ALL & ~ E_NOTICE);
-@apache_setenv('no-gzip', 1);
-@ini_set('zlib.output_compression', 'Off');
-
-if (isset($_GET["mime"]))
- $file = $CONVERT.'/'.$_GET["mime"].'/'.preg_replace('/\.[^.]*$/', '.'.$_GET["mime"], $_GET["video"]);
-else
- $file = $DIR.'/'.$_GET["video"]; // The media file's location
-$size = filesize($file); // The size of the file
-$mime = mime_content_type($file);
+/** Generate a source entry for a given file.
+ Returns source tag, if the image file exists, empty otherwise. */
+function source($dir, $file, $mime=NULL) {
+ $URL=pageUrl();
+ $path=$dir.'/'.$file;
+ if (is_file($path)) {
+ if (!$mime) $type=mime_content_type($path);
+ else $type='video/'.$mime;
+ echo '