support no identify and no transcode/mencoder
[booh] / bin / booh
index 325205a14ae69eeff37c600df1f664d6087a3db1..63729b7ccdf048706b1c716a89bbeff3f24ed828 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -109,6 +109,20 @@ def read_config
 end
 
 def check_config
+    if !system("which convert >/dev/null 2>/dev/null")
+        show_popup($main_window, utf8(_("The program 'convert' is needed. Please install it.
+It is generally available with the 'ImageMagick' software package.")), { :pos_centered => true })
+        exit 1
+    end
+    if !system("which identify >/dev/null 2>/dev/null")
+        show_popup($main_window, utf8(_("The program 'identify' is needed to get images sizes and EXIF data. Please install it.
+It is generally available with the 'ImageMagick' software package.")), { :pos_centered => true })
+    end
+    missing = %w(transcode mencoder).delete_if { |prg| system("which #{prg} >/dev/null 2>/dev/null") }
+    if missing != []
+        show_popup($main_window, utf8(_("The following program(s) are needed to handle videos: '%s'. Videos will be ignored.") % missing.join(', ')), { :pos_centered => true })
+    end
+
     viewer_binary = $config['video-viewer'].split.first
     if viewer_binary && !File.executable?(viewer_binary)
         show_popup($main_window, utf8(_("The configured video viewer seems to be unavailable.