App-tkiv
view release on metacpan or search on metacpan
keys_delete => [qw( Delete )],
keys_slideshow => [qw( Key-w Key-s )],
keys_exif => [qw( Key-i )],
keys_exifinfo => [qw( Shift-I )],
keys_decoration => [qw( Key-d )],
keys_focusthumbs => [qw( Key-t )],
keys_scroll_up => [qw( Alt-Up Control-Up )],
keys_scroll_down => [qw( Alt-Down Control-Down )],
keys_scroll_left => [qw( Alt-Left Control-Left )],
keys_scroll_right => [qw( Alt-Right Control-Right )],
keys_imgpos_nw => [qw( Alt-u )],
keys_imgpos_n => [qw( Alt-i )],
keys_imgpos_ne => [qw( Alt-o )],
keys_imgpos_e => [qw( Alt-l )],
keys_imgpos_se => [qw( Alt-period )],
keys_imgpos_s => [qw( Alt-comma )],
keys_imgpos_sw => [qw( Alt-m )],
keys_imgpos_w => [qw( Alt-j )],
keys_imgpos_c => [qw( Alt-k )],
keys_crop => [qw( Control-y )],
);
sub usage {
my ($show_opt) = (@_, 0);
warn "usage: iv.pl [-f] [option=value ...] [dir]\n";
if ($show_opt) {
foreach my $o (sort keys %Option) {
my $v = $o =~ m/^keys_/
? "(".(join" ",@{$Option{$o}}).")"
: $Option{$o};
my $alt = {
imageposition => "\t\t(nw n ne e se s sw w c)",
slideposition => "\t\t(nw n ne e se s sw w c)",
thumbposition => "\t\t(nw n ne e se s sw w c)",
thumbsorting => "\t(default caseless date size random)",
thumbsortorder => "\t(ascending descending)",
}->{$o} || "";
printf STDERR " %-15s %s%s\n", $o, $v, $alt;
}
}
exit 0;
} # usage
# TODO: * save/load from .ivrc buttons on option window
# * Slideshow behaviour: location, dir depth, cycling
# randomness, slide lists, full screen background (no decoration)
# * Slideshow play list
# * Slideshow loop control
# * Image manipulation
# - Crop
# - Save, save as
# * Titles and decoration behaviour
# - adjust height/width of screen-fit images to decoration
# I just cannot get $iv->overrideredirect (1) to work as I want
# * Hide dirs above dt root
# - Allow a set of dirs from the command line
# * use Tk::Animation for animated gif's
# * Menu's ?
# * Auto-sense image load time for slideshows
# * Move onward to App::tkiv (with iv => tkiv link)
# Filter out the irfanview options that I don't support
@ARGV = grep { !m{^/(hide|thumbs?)(=\d+)?$} } @ARGV;
@ARGV == 1 and $ARGV[0] =~ m/^-[h?]$/ and usage (0);
@ARGV == 1 and $ARGV[0] =~ m/^-+(help|info)$/ and usage (1);
use Getopt::Long qw(:config bundling nopermute passthrough);
my $opt_f = 0; # Start with full-screen pics
my $opt_v = 0; # Verbosity / debug
my $opt_s = 0; # Start slideshow immediately
my $opt_1 = 0; # On startup, select first image and minimize thumbnail view
GetOptions (
"v:1" => \$opt_v,
"f" => \$opt_f,
"s" => \$opt_s,
"1" => \$opt_1,
) or usage (0);
use Cwd qw( realpath );
use Tk;
use Tk::JPEG;
use Tk::PNG;
eval "use Tk::TIFF;";
use Tk::Bitmap;
use Tk::Pixmap;
use Tk::Photo;
use Tk::Pane;
use Tk::DirTree;
use Tk::Dialog;
use Tk::Balloon;
use Tk::BrowseEntry;
use Tk::Animation;
use File::Temp qw( tempdir tempfile );
use File::Copy;
#use Data::Peek;
# Time to fetch image dimensions for 3500 images
our $exiftool = 0; # 26.5
our $iinftool = 0; # 4.5
our $imsztool = 0; # 0.2
our $exiftran = 0;
eval {
require Image::ExifTool;
Image::ExifTool->import ("ImageInfo");
$exiftool = Image::ExifTool->new ();
};
eval {
require Image::Size;
Image::Size->import ("imgsize");
$imsztool = exists &imgsize;
};
eval {
require Image::Info;
Image::Info->import ("image_info", "dim");
$iinftool = exists &image_info;
};
-x "/usr/bin/exiftran" and $exiftran = 1;
( run in 0.565 second using v1.01-cache-2.11-cpan-39bf76dae61 )