show aspect in fullscreen view - in order to more easily know which images to fix...
authorGuillaume Cottenceau <gcottenc@gmail.com>
Sat, 12 Jul 2008 19:24:25 +0000 (21:24 +0200)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Sat, 12 Jul 2008 19:24:25 +0000 (21:24 +0200)
bin/booh

index ead68716444cd1eb8d95a3884009eb9b2b9c60f2..1d9666fc5163b149dd9a0319e22e6168dae439ee 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -296,7 +296,13 @@ def view_element(filename, closures)
                 end
         end
     end
-    evt = Gtk::EventBox.new.add(Gtk::Alignment.new(0.5, 0.5, 0, 0).add(Gtk::Frame.new.add(Gtk::Image.new(dest_img)).set_shadow_type(Gtk::SHADOW_ETCHED_OUT)))
+    aspect = utf8(_("Aspect: unknown"))
+    size = get_image_size(from_utf8("#{$current_path}/#{filename}"))
+    if size
+        aspect = utf8(_("Aspect: %s") % sprintf("%1.3f", size[:x].to_f/size[:y]))
+    end
+    vbox = Gtk::VBox.new.add(Gtk::Image.new(dest_img)).add(Gtk::Label.new.set_markup("<i>#{aspect}</i>"))
+    evt = Gtk::EventBox.new.add(Gtk::Alignment.new(0.5, 0.5, 0, 0).add(Gtk::Frame.new.add(vbox).set_shadow_type(Gtk::SHADOW_ETCHED_OUT)))
     evt.signal_connect('button-press-event') { |this, event|
         if event.event_type == Gdk::Event::BUTTON_PRESS && event.button == 1
             $config['nogestures'] or $gesture_press = { :x => event.x, :y => event.y }