App-tkiv
view release on metacpan or search on metacpan
0.100 - 05 Mar 2009, H.Merijn Brand
* Cropping/selection (switch from Label to Canvas to display full images)
* Data::Peek instead of Data::Dumper
0.051 - 30 Jan 2009, H.Merijn Brand
* Die if PhotoXY fails
0.050 - 09 Jul 2008, H.Merijn Brand
* Switch font syntax
0.049 - 08 Jul 2008, H.Merijn Brand
* Exif Info window now expands (top level pack i.o. grid)
0.048 - 25 Nov 2007, H.Merijn Brand
* Added NEF (a TIFF variant)
0.047 - 05 Nov 2007, H.Merijn Brand
* Small changes in preparation of App::tkiv (defined-or)
thumbsorting => "default",
thumbsortorder => "ascending",
imageposition => "nw",
imagedir => ".",
slideshowdelay => 1500, # in milliseconds
slideposition => "c",
slidefull => 0,
slidecover => 0,
maxx => 9999,
maxy => 9999,
# smallfont => "-misc-fixed-medium-r-normal--7-70-75-75-c-50-iso10646-1",
smallfont => "{Liberation Mono} 8",
selectionfont => "{Liberation Sans} 5",
selectioncolor => "Yellow",
confirmdelete => 1,
removetarget => 0,
imagefull => 0,
decoration => 1,
showexifinfo => 0,
exifinfocolor => "Blue",
scrollspeed => 3,
titledirs => 0,
titleindex => 0,
my $ei = shift or return;
my $dto = $ei->{DateTimeOriginal} // "";
my $iso = $ei->{ISO} ? "ISO $ei->{ISO}" : "";
my $spd = $ei->{ShutterSpeed} // $ei->{exposureTime} // "";
my $ape = $ei->{Aperture} // $ei->{FNumber};
$ape = $ape ? "F$ape" : "";
my $fln = $ei->{FocalLengthIn35mmFormat} // $ei->{FocalLength} // "";
$w->createText (5, 5,
-anchor => "nw",
-fill => $Option{exifinfocolor},
-font => $Option{smallfont},
-text => join ("\x{00b7}", grep m/\S/, $dto, $iso, $ape, $spd, $fln),
-tags => "exifinfo",
);
if ($dto) {
my $awb = $ei->{WhiteBalance} // "";
my $fls = ($ei->{Flash} // $ei->{FlashFired} // "") =~
m/^(yes|true|on|fired|1)\b/i ? "With flash" : "No flash";
my $pgm = $ei->{ExposureProgram} //
$ei->{ShootingMode} //
$ei->{SceneMode} // "";
my $sct = $ei->{SceneType} // "";
$w->createText (5, 20,
-anchor => "nw",
-fill => $Option{exifinfocolor},
-font => $Option{smallfont},
-text => join ("\x{00b7}", grep m/\S/, $awb, $fls, $pgm, $sct),
-tags => "exifinfo",
);
$w->createText (5, 35,
-anchor => "nw",
-fill => $Option{exifinfocolor},
-font => $Option{smallfont},
-text => join ("\x{00b7}" =>
map { join " " => map { ucfirst lc $_ } split m/\s+/ => $_ }
grep m/\S/, map { $ei->{$_} // "" }
"Make", # Nikon
"Model", # Coolpix S9700
"DeviceType", # Cell Phone
"FileSource", # Digital Camera
),
-tags => "exifinfo",
);
-height => int ($cy * .65))->pack (-expand => 1, -fill => "both");
$ow->Subwidget ("${_}scrollbar")->configure (-width => 6) for qw( x y );
my @exif = sort { lc $a cmp lc $b } keys %$exif;
my $half = int (@exif / 2);
foreach my $row (0 .. ($half - 1)) {
$ow->Label (
-text => $exif[$row],
-anchor => "w",
-fg => "DarkGreen",
-font => $Option{smallfont},
)->grid (-row => $row, -column => 0, -sticky => "news");
$ow->Label (
-text => $exif->{$exif[$row]},
-anchor => "w",
-fg => "DarkBlue",
-font => $Option{smallfont},
)->grid (-row => $row, -column => 1, -sticky => "news");
$row + $half > $#exif and last;
$ow->Label (
-text => $exif[$row + $half],
-anchor => "w",
-fg => "DarkGreen",
-font => $Option{smallfont},
)->grid (-row => $row, -column => 2, -sticky => "news");
$ow->Label (
-text => $exif->{$exif[$row + $half]},
-anchor => "w",
-fg => "DarkBlue",
-font => $Option{smallfont},
)->grid (-row => $row, -column => 3, -sticky => "news");
$row++;
}
# Destroy
foreach my $W ($ow, $tl) {
$W->bind ($_, sub {
if (Exists ($ow)) { $ow->destroy; $ow = undef; }
if (Exists ($tl)) { $tl->destroy; $tl = undef; }
}) for @{$Option{keys_quit}};
$W->bind ($_, \&exit) for @{$Option{keys_quit_all}};
$action & 020 and $selection{"Ey"} = $my;
my @x = sort { $a <=> $b } @selection{qw( Sx Ex )};
my @y = sort { $a <=> $b } @selection{qw( Sy Ey )};
my @s = ($x[1] - $x[0] + 1, $y[1] - $y[0] + 1);
$fp->createRectangle ($x[0], $y[0], $x[1], $y[1],
-outline => $Option{selectioncolor},
-tags => "selection");
$fp->createText ($x[0] + 2, $y[0] + 2,
-anchor => "nw",
-fill => $Option{selectioncolor},
-font => $Option{selectionfont},
-text => "$s[0]x$s[1]",
-tags => "selection",
);
});
});
$fp->CanvasBind ("<ButtonRelease-1>", sub {
if (exists $selection{Sx} and
abs ($selection{Sx} - $selection{Ex}) < 5 ||
abs ($selection{Sy} - $selection{Ey}) < 5) {
$dt->bind ($_, sub {
(my $up = $idir) =~ s:/[^/]+$:: or return;
$dt->open ($up);
$dt->chdir ($idir);
$dt->open ($idir);
$dt->xview (moveto => .60);
dtcmd ($idir);
}) for qw( <greater> );
my @fs = (-font => $Option{smallfont});
my @fsv = (@fs, -foreground => "Maroon");
my @fst = (@fs, -foreground => "Navy");
$df->Label (-textvariable => \$ti, @fsv)->pack (-side => "left");
$df->Label (-text => "#", @fst)->pack (-side => "left");
$df->Label (-textvariable => \$ni, @fsv)->pack (-side => "left");
$df->Label (-text => "T", @fst)->pack (-side => "left");
$df->Label (-textvariable => \$tr, @fsv)->pack (-side => "left");
$df->Label (-text => "O", @fst)->pack (-side => "left");
$df->Label (-textvariable => \$or, @fsv)->pack (-side => "left");
$df->Label (-text => "F", @fst)->pack (-side => "left");
n is the index and N is the total number of images in the current
thumb-view
maxX => 9999,
maximum horizontal resolution (some size quests are unreliable)
maxY => 9999,
maximum vertical resolution (some size quests are unreliable)
smallFont => "{Liberation Mono} 8",",
define the font for labels
selectionFont => "{Liberation Sans} 5",
the font used to display information with the selection rectangle
selectionColor => "Yellow",
the color used when drawing selection rectangles
confirmDelete => 1,
ask for confirmation when deleting images. default 1 (true)
removeTarget => 0,
remove target folder when it is empty. default 0 (false)
lib/App/tkiv.pm view on Meta::CPAN
n is the index and N is the total number of images in the current
thumb-view
maxX => 9999,
maximum horizontal resolution (some size quests are unreliable)
maxY => 9999,
maximum vertical resolution (some size quests are unreliable)
smallFont => "{Liberation Mono} 8",",
define the font for labels
selectionFont => "{Liberation Sans} 5",
the font used to display information with the selection rectangle
selectionColor => "Yellow",
the color used when drawing selection rectangles
confirmDelete => 1,
ask for confirmation when deleting images. default 1 (true)
removeTarget => 0,
remove target folder when it is empty. default 0 (false)
( run in 2.883 seconds using v1.01-cache-2.11-cpan-5735350b133 )