diff options
| author | Andy Staudacher <andy.st@gmail.com> | 2009-06-16 20:26:49 -0700 | 
|---|---|---|
| committer | Andy Staudacher <andy.st@gmail.com> | 2009-06-16 20:26:49 -0700 | 
| commit | 06ed45f0cb867057eefd5a45d04cba6b8be41411 (patch) | |
| tree | f4ec5ebff47b9264734a06a611172277acb3c9a1 /modules/gallery | |
| parent | be226b9baa8ce21431e35c32277fda2e8c94a216 (diff) | |
| parent | baea5e3a1b5a258269accb7ee53f5167607833c2 (diff) | |
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery')
| -rw-r--r-- | modules/gallery/controllers/simple_uploader.php | 3 | ||||
| -rw-r--r-- | modules/gallery/helpers/graphics.php | 7 | ||||
| -rw-r--r-- | modules/gallery/helpers/movie.php | 7 | ||||
| -rwxr-xr-x | modules/gallery/images/missing_movie.png | bin | 0 -> 8474 bytes | 
4 files changed, 14 insertions, 3 deletions
| diff --git a/modules/gallery/controllers/simple_uploader.php b/modules/gallery/controllers/simple_uploader.php index dfbd4f17..e68df2b8 100644 --- a/modules/gallery/controllers/simple_uploader.php +++ b/modules/gallery/controllers/simple_uploader.php @@ -39,7 +39,8 @@ class Simple_Uploader_Controller extends Controller {      access::verify_csrf();      $file_validation = new Validation($_FILES); -    $file_validation->add_rules("Filedata", "upload::valid", "upload::type[gif,jpg,png,flv,mp4]"); +    $file_validation->add_rules( +      "Filedata", "upload::valid", "upload::type[gif,jpg,jpeg,png,flv,mp4]");      if ($file_validation->validate()) {        // SimpleUploader.swf does not yet call /start directly, so simulate it here for now.        if (!batch::in_progress()) { diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index feebfb34..3f3317ae 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -135,7 +135,12 @@ class graphics_Core {          if ($input_item->is_movie()) {            // Convert the movie to a JPG first            $output_file = preg_replace("/...$/", "jpg", $output_file); -          movie::extract_frame($input_file, $output_file); +          try { +            movie::extract_frame($input_file, $output_file); +          } catch (Exception $e) { +            // Assuming this is MISSING_FFMPEG for now +            copy(MODPATH . "gallery/images/missing_movie.png", $output_file); +          }            $working_file = $output_file;          } else {            $working_file = $input_file; diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php index 1d1d29d1..28c15d81 100644 --- a/modules/gallery/helpers/movie.php +++ b/modules/gallery/helpers/movie.php @@ -53,7 +53,12 @@ class movie_Core {        throw new Exception("@todo NAME_CANNOT_END_IN_PERIOD");      } -    $movie_info = movie::getmoviesize($filename); +    try { +      $movie_info = movie::getmoviesize($filename); +    } catch (Exception $e) { +      // Assuming this is MISSING_FFMPEG for now +      $movie_info = getimagesize(MODPATH . "gallery/images/missing_movie.png"); +    }      // Force an extension onto the name      $pi = pathinfo($filename); diff --git a/modules/gallery/images/missing_movie.png b/modules/gallery/images/missing_movie.pngBinary files differ new file mode 100755 index 00000000..fdc97779 --- /dev/null +++ b/modules/gallery/images/missing_movie.png | 
