return @@thumbnails_height
end
- attr_accessor :path, :type, :angle, :button, :image, :alignment, :removed, :labeled
+ attr_accessor :path, :guipath, :type, :angle, :button, :image, :alignment, :removed, :labeled
- def initialize(path, type)
+ def initialize(path, type, guipath)
@path = path
@type = type
+ @guipath = guipath
if @@max_width.nil?
@@max_width = $main_window.root_window.size[0] - $labels_vbox.allocation.width - ( $videoborder_pixbuf.width + MainView.borders_thickness) * 2
end
def get_beautified_name
if type == 'image'
size = get_image_size(path)
- return _("%s (%sx%s, %s KB)") % [@path[$workingdir.length + 1 .. -1].gsub(/\.[^.]+$/, ''),
+ return _("%s (%sx%s, %s KB)") % [@guipath.gsub(/\.[^.]+$/, ''),
size[:x],
size[:y],
commify(file_size(path)/1024)]
else
- return _("%s (video - %s KB)") % [@path[$workingdir.length + 1 .. -1].gsub(/\.[^.]+$/, ''),
+ return _("%s (video - %s KB)") % [@guipath.gsub(/\.[^.]+$/, ''),
commify(file_size(path)/1024)]
end
end
$preloader_allowed = false
end
-def open_dir(path)
+def open_dir(*paths)
#- remove visual stuff, so that user will see something is happening
reset_all
sb_msg(_("Scanning source directory..."))
Gtk.main_iteration while Gtk.events_pending?
- path = File.expand_path(path.sub(%r|/$|, ''))
- examined_dirs = `find '#{path}' -type d -follow`.sort.collect { |v| v.chomp }
- #- validate first
- examined_dirs.each { |dir|
- if dir =~ /'/
- return utf8(_("Source directory or sub-directories can't contain a single-quote character, sorry: %s") % dir)
- end
- Dir.entries(dir).each { |file|
- if file =~ /'/ && type = entry2type(file) && type == 'video'
- return utf8(_("Videos can't contain a single quote character ('), sorry: %s") % "#{dir}/#{file}")
- end
- }
- }
+ for path in paths
+ path = File.expand_path(path.sub(%r|/$|, ''))
+ $workingdir = path
+ entries = []
+ if File.directory?(path)
+ examined_dirs = `find '#{path}' -type d -follow`.sort.collect { |v| v.chomp }
+ #- validate first
+ examined_dirs.each { |dir|
+ if dir =~ /'/
+ return utf8(_("Source directory or sub-directories can't contain a single-quote character, sorry: %s") % dir)
+ end
+ Dir.entries(dir).each { |file|
+ if file =~ /'/ && type = entry2type(file) && type == 'video'
+ return utf8(_("Videos can't contain a single quote character ('), sorry: %s") % "#{dir}/#{file}")
+ end
+ }
+ }
+
+ #- scan for populate second
+ examined_dirs.each { |dir|
+ if File.basename(dir) =~ /^\./
+ msg 1, _("Ignoring directory %s, begins with a dot (indicating a hidden directory)") % dir
+ next
+ end
+ entries += Dir.entries(dir).collect { |file| File.join(dir, file) }
+ }
- #- scan for populate second
- examined_dirs.each { |dir|
- if File.basename(dir) =~ /^\./
- msg 1, _("Ignoring directory %s, begins with a dot (indicating a hidden directory)") % dir
- next
+ else
+ entries << path
end
- entries = Dir.entries(dir)
+
if $sort_by_exif_date
dates = {}
entries.each { |file|
- date_time = Exif.datetimeoriginal(File.join(dir, file))
+ date_time = Exif.datetimeoriginal(file)
if ! date_time.nil?
dates[file] = date_time
end
entries.each { |file|
type = entry2type(file)
if type
- $allentries << Entry.new(File.join(dir, file), type)
+ if File.directory?(path)
+ $allentries << Entry.new(file, type, file[path.length + 1 .. -1])
+ else
+ $allentries << Entry.new(file, type, file)
+ end
end
}
- }
- $workingdir = path
+ end
return nil
end
check_config
if ARGV[0]
- if msg = open_dir(ARGV[0])
+ if msg = open_dir(*ARGV)
puts msg
else
show_entries($allentries)
.TH BOOH 1 "March 2008" "BOOH" "The booh web-album"
.SH NAME
-booh-classifier \- pictures/videos classifier aimed at being run prior to booh
+booh-classifier \- photos and videos classifier aimed at being run prior to booh
.SH SYNOPSIS
\fBbooh-classifier\fR [\fIOPTION\fR]... [\fIDIRNAME\fR]
.SH DESCRIPTION
-\fBbooh-classifier\fR is a pictures/videos classifier. It scans a
-directory looking for pictures and videos, presenting them with a
+\fBbooh-classifier\fR is a photos and videos classifier. It scans a
+directory looking for photos and videos, presenting them with a
small thumbnail on the bottom of the application window; the main
part shows a "fullscreen" version of the currently selected
-picture/video. The aim is to mark pictures/videos for deletion or
+photo or video. The aim is to mark photos/videos for deletion or
with user-created labels, and in the end remove the
-pictures/videos marked for deletiong and move the pictures/video
+photos/videos marked for deletion and move the photos/videos
marked with labels.
.PP
Normally, you can make use of \fBbooh-classifier\fR to classify
-your pictures/videos coming from your digital camera, and once
-they are classified you can use \fBbooh\fR to create a web-album.
+your photos/videos coming from your digital camera, and once
+they are classified, you can use \fBbooh\fR to create a web-album.
.SH OPTIONS
.TP