X-Git-Url: http://git.zarb.org/?p=booh;a=blobdiff_plain;f=bin%2Fbooh-classifier;h=3be4fab23d05dc1e5ca9ee46b0649b64d269b3c6;hp=c85ed74c0e9147f46b808cfe2311727432b10837;hb=4feaa778f5a4b9b8d4ea30473f84b45c7bb313b2;hpb=de58bf561d075d13fc5bfc117dae0fefcb751541 diff --git a/bin/booh-classifier b/bin/booh-classifier index c85ed74..3be4fab 100644 --- a/bin/booh-classifier +++ b/bin/booh-classifier @@ -34,7 +34,7 @@ require 'gettext' include GetText bindtextdomain("booh") -require 'booh/rexml/document' +require 'rexml/document' include REXML require 'booh/booh-lib' @@ -315,14 +315,14 @@ class Entry if @pixbuf_full.width.to_f / @pixbuf_full.height > width.to_f / height resized_height = @pixbuf_full.height * (width.to_f/@pixbuf_full.width) if @pixbuf_full.width > width || @pixbuf_full.height > resized_height - @pixbuf_main = @pixbuf_full.scale(width, resized_height, Gdk::Pixbuf::INTERP_BILINEAR) + @pixbuf_main = @pixbuf_full.scale(width, resized_height, :bilinear) else @pixbuf_main = @pixbuf_full end else resized_width = @pixbuf_full.width * (height.to_f/@pixbuf_full.height) if @pixbuf_full.width > resized_width || @pixbuf_full.height > height - @pixbuf_main = @pixbuf_full.scale(resized_width, height, Gdk::Pixbuf::INTERP_BILINEAR) + @pixbuf_main = @pixbuf_full.scale(resized_width, height, :bilinear) else @pixbuf_main = @pixbuf_full end @@ -348,7 +348,7 @@ class Entry if @pixbuf_thumbnail.nil? if @pixbuf_main msg 3, ">>> pixbuf_thumbnail from main #{path}" - @pixbuf_thumbnail = @pixbuf_main.scale(@pixbuf_main.width * (Entry.thumbnails_height.to_f/@pixbuf_main.height), Entry.thumbnails_height, Gdk::Pixbuf::INTERP_BILINEAR) + @pixbuf_thumbnail = @pixbuf_main.scale(@pixbuf_main.width * (Entry.thumbnails_height.to_f/@pixbuf_main.height), Entry.thumbnails_height, :bilinear) else msg 3, ">>> pixbuf_thumbnail from file #{path}" @pixbuf_thumbnail = load_into_pixbuf_at_size { |w, h| @@ -477,7 +477,7 @@ class Entry #- use a pixbuf loader and check Gtk.events_pending? on each chunk, to keep the UI responsive even #- if loaded pictures are several MBs large if @loader.nil? - @loader = Gdk::PixbufLoader.new + @loader = GdkPixbuf::PixbufLoader.new @loader.signal_connect('size-prepared') { |l, w, h| @loader.set_size(*specify_size.call(w, h)) } @@ -1243,7 +1243,7 @@ def show_entries(allentries) update_counters sb_msg(_("Loading images...")) $loading_progressbar.fraction = 0 - $loading_progressbar.text = utf8(_("Loading... %d%") % 0) + $loading_progressbar.text = utf8(_("Loading... %d%%") % 0) $loading_progressbar.show t1 = Time.now total_loaded_files = 0 @@ -1295,7 +1295,7 @@ def show_entries(allentries) allentries.delete_at(i) end $loading_progressbar.fraction = i.to_f / allentries.size - $loading_progressbar.text = utf8(_("Loading... %d%") % (100 * $loading_progressbar.fraction)) + $loading_progressbar.text = utf8(_("Loading... %d%%") % (100 * $loading_progressbar.fraction)) if $quit return end @@ -1375,6 +1375,8 @@ def open_dir(*paths) date_time = Exif.datetimeoriginal(file) if ! date_time.nil? dates[file] = date_time + elsif file =~ /(20\d{2}).?(\d{2}).?(\d{2}).(\d{2}).?(\d{2}).?(\d{2})/ + dates[file] = "#$1:#$2:#$3 #$4:#$5:#$6" end } entries = smartsort(entries, dates) @@ -1483,7 +1485,7 @@ def execute table.attach(examples, 2, 3, row, row + 1, Gtk::FILL, Gtk::FILL, 5, 5) if counter == 0 - return {} + next {} end combostore = Gtk::ListStore.new(Gdk::Pixbuf, String) @@ -2021,7 +2023,7 @@ end def create_main_window - $videoborder_pixbuf = Gdk::Pixbuf.new("#{$FPATH}/images/video_border.png") + $videoborder_pixbuf = GdkPixbuf::Pixbuf.new(:file => "#{$FPATH}/images/video_border.png") $videoborder_pixmap, = $videoborder_pixbuf.render_pixmap_and_mask(0) mb = create_menubar @@ -2031,7 +2033,7 @@ def create_main_window mainview_hbox = Gtk::HBox.new mainview_hbox.pack_start(Gtk::Alignment.new(0.5, 0, 1, 1).add(left_vbox = Gtk::VBox.new(false, 5)), false, true) left_vbox.pack_start(($labels_vbox = Gtk::VBox.new(false, 5)), false, true) - left_vbox.pack_end($loading_progressbar = Gtk::ProgressBar.new.set_text(utf8(_("Loading... %d%") % 0)), false, true) + left_vbox.pack_end($loading_progressbar = Gtk::ProgressBar.new.set_text(utf8(_("Loading... %d%%") % 0)), false, true) mainview_hbox.pack_start($mainview = MainView.new, true, true) main_vbox.pack_start(mainview_hbox, true, true) $imagesline_sw = Gtk::ScrolledWindow.new(nil, nil)