mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-11 23:29:08 -04:00
Use a placeholder image if ffmpeg is missing instead of throwing an
exception which would get silently swallowed by swfUpload.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
BIN
modules/gallery/images/missing_movie.png
Normal file
BIN
modules/gallery/images/missing_movie.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Reference in New Issue
Block a user