diff --git a/3.0/modules/noffmpeg/helpers/movie.php b/3.0/modules/noffmpeg/helpers/movie.php
index a42804d2..99308994 100644
--- a/3.0/modules/noffmpeg/helpers/movie.php
+++ b/3.0/modules/noffmpeg/helpers/movie.php
@@ -24,6 +24,7 @@
* Note: by design, this class does not do any permission checking.
*/
+// rWatcher edit: include MP4Info.php library.
include MODPATH . "noffmpeg/libraries/MP4Info.php";
class movie_Core {
@@ -61,7 +62,7 @@ class movie_Core {
}
static function extract_frame($input_file, $output_file) {
- $ffmpeg = self::find_ffmpeg();
+ $ffmpeg = movie::find_ffmpeg();
if (empty($ffmpeg)) {
// BEGIN rWatcher Edit.
copy(MODPATH . "noffmpeg/images/missing_movie.png", $output_file);
@@ -89,27 +90,23 @@ class movie_Core {
}
}
+ /**
+ * Return the path to the ffmpeg binary if one exists and is executable, or null.
+ */
static function find_ffmpeg() {
if (!($ffmpeg_path = module::get_var("gallery", "ffmpeg_path")) || !file_exists($ffmpeg_path)) {
- $graphics_path = module::get_var("gallery", "graphics_toolkit_path", null);
-
- putenv("PATH=" . getenv("PATH") . (empty($graphics_path) ? "" : ":$graphics_path") .
- ":/usr/local/bin:/opt/local/bin:/opt/bin");
- if (function_exists("exec")) {
- $ffmpeg_path = exec("which ffmpeg");
- }
-
+ $ffmpeg_path = system::find_binary(
+ "ffmpeg", module::get_var("gallery", "graphics_toolkit_path"));
module::set_var("gallery", "ffmpeg_path", $ffmpeg_path);
}
return $ffmpeg_path;
}
-
/**
* Return the width, height, mime_type and extension of the given movie file.
*/
static function get_file_metadata($file_path) {
- $ffmpeg = self::find_ffmpeg();
+ $ffmpeg = movie::find_ffmpeg();
if (empty($ffmpeg)) {
// BEGIN rWatcher Edit.
$pi = pathinfo($file_path);
@@ -147,4 +144,4 @@ class movie_Core {
return array($width, $height, $mime_type, $extension);
}
-}
+}
\ No newline at end of file
diff --git a/3.0/modules/noffmpeg/views/form_uploadify.html.php b/3.0/modules/noffmpeg/views/form_uploadify.html.php
new file mode 100644
index 00000000..911e02d5
--- /dev/null
+++ b/3.0/modules/noffmpeg/views/form_uploadify.html.php
@@ -0,0 +1,164 @@
+
+
+
+
+
+
+ if ($suhosin_session_encrypt || (identity::active_user()->admin && !$movies_allowed)): ?>
+
+ if ($suhosin_session_encrypt): ?>
+
+ = t("Error: your server is configured to use the suhosin.session.encrypt setting from Suhosin. You must disable this setting to upload photos.",
+ array("encrypt_url" => "http://www.hardened-php.net/suhosin/configuration.html#suhosin.session.encrypt",
+ "suhosin_url" => "http://www.hardened-php.net/suhosin/")) ?>
+
+ = t("Can't find ffmpeg on your system. Movie uploading disabled. Help!", array("help_url" => "http://codex.gallery2.org/Gallery3:FAQ#Why_does_it_say_I.27m_missing_ffmpeg.3F")) ?>
+
+ endif ?>
+
+ endif ?>
+
+
+
+ = t("Photos will be uploaded to album: ") ?>
+
+
+ foreach ($album->parents() as $i => $parent): ?>
+
> = html::clean($parent->title) ?>
+ endforeach ?>
+
= html::purify($album->title) ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ = t("Your browser must have Adobe Flash Player version %flash_minimum_version or greater installed to use this feature.", array("flash_minimum_version" => $flash_minimum_version)) ?>
+
\ No newline at end of file
diff --git a/3.1/modules/noffmpeg/helpers/movie.php b/3.1/modules/noffmpeg/helpers/movie.php
index a42804d2..99308994 100644
--- a/3.1/modules/noffmpeg/helpers/movie.php
+++ b/3.1/modules/noffmpeg/helpers/movie.php
@@ -24,6 +24,7 @@
* Note: by design, this class does not do any permission checking.
*/
+// rWatcher edit: include MP4Info.php library.
include MODPATH . "noffmpeg/libraries/MP4Info.php";
class movie_Core {
@@ -61,7 +62,7 @@ class movie_Core {
}
static function extract_frame($input_file, $output_file) {
- $ffmpeg = self::find_ffmpeg();
+ $ffmpeg = movie::find_ffmpeg();
if (empty($ffmpeg)) {
// BEGIN rWatcher Edit.
copy(MODPATH . "noffmpeg/images/missing_movie.png", $output_file);
@@ -89,27 +90,23 @@ class movie_Core {
}
}
+ /**
+ * Return the path to the ffmpeg binary if one exists and is executable, or null.
+ */
static function find_ffmpeg() {
if (!($ffmpeg_path = module::get_var("gallery", "ffmpeg_path")) || !file_exists($ffmpeg_path)) {
- $graphics_path = module::get_var("gallery", "graphics_toolkit_path", null);
-
- putenv("PATH=" . getenv("PATH") . (empty($graphics_path) ? "" : ":$graphics_path") .
- ":/usr/local/bin:/opt/local/bin:/opt/bin");
- if (function_exists("exec")) {
- $ffmpeg_path = exec("which ffmpeg");
- }
-
+ $ffmpeg_path = system::find_binary(
+ "ffmpeg", module::get_var("gallery", "graphics_toolkit_path"));
module::set_var("gallery", "ffmpeg_path", $ffmpeg_path);
}
return $ffmpeg_path;
}
-
/**
* Return the width, height, mime_type and extension of the given movie file.
*/
static function get_file_metadata($file_path) {
- $ffmpeg = self::find_ffmpeg();
+ $ffmpeg = movie::find_ffmpeg();
if (empty($ffmpeg)) {
// BEGIN rWatcher Edit.
$pi = pathinfo($file_path);
@@ -147,4 +144,4 @@ class movie_Core {
return array($width, $height, $mime_type, $extension);
}
-}
+}
\ No newline at end of file
diff --git a/3.1/modules/noffmpeg/views/form_uploadify.html.php b/3.1/modules/noffmpeg/views/form_uploadify.html.php
new file mode 100644
index 00000000..911e02d5
--- /dev/null
+++ b/3.1/modules/noffmpeg/views/form_uploadify.html.php
@@ -0,0 +1,164 @@
+
+
+
+
+
+
+ if ($suhosin_session_encrypt || (identity::active_user()->admin && !$movies_allowed)): ?>
+
+ if ($suhosin_session_encrypt): ?>
+
+ = t("Error: your server is configured to use the suhosin.session.encrypt setting from Suhosin. You must disable this setting to upload photos.",
+ array("encrypt_url" => "http://www.hardened-php.net/suhosin/configuration.html#suhosin.session.encrypt",
+ "suhosin_url" => "http://www.hardened-php.net/suhosin/")) ?>
+
+ = t("Can't find ffmpeg on your system. Movie uploading disabled. Help!", array("help_url" => "http://codex.gallery2.org/Gallery3:FAQ#Why_does_it_say_I.27m_missing_ffmpeg.3F")) ?>
+
+ endif ?>
+
+ endif ?>
+
+
+
+ = t("Photos will be uploaded to album: ") ?>
+
+
+ foreach ($album->parents() as $i => $parent): ?>
+
> = html::clean($parent->title) ?>
+ endforeach ?>
+
= html::purify($album->title) ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ = t("Your browser must have Adobe Flash Player version %flash_minimum_version or greater installed to use this feature.", array("flash_minimum_version" => $flash_minimum_version)) ?>
+