After the
__DATA__ you must paste the POD documentation:
__DATA__
=head1 NAME
PicWoodPecker
=head1 SYNOPSIS
perl picwoodpecker.pl [-s -d -debug -pr -wr -p -x -y -nothumbs -e -qua
+lity -pngcompression -df]
=head1 OPTIONS
-s|src|source path
the path where search for jpg files to be loaded
Can be modified in the Tk interface
-d|dest|destination path
path used to save files
Can be modified in the Tk interface
-debug
print more information on the screen
Can be modified in the Tk interface
-pr|phratio floating point
the ratio used to display the current photo
Can be modified in the Tk interface
-wr|winratio floating point
the ratio to size the window where the photo is di
+splayed
Can be modified in the Tk interface
-p|preload integer
how many photos load in memory after and before th
+e current
one. Can increase drawing speed time
-x|gridx integer
how many columns in the thumbnail grid
-y|gridy integer
how many rows in the thumbnail grid
-nothumbs
does not load thumbnails at all
-e|extension jpg|gif|png|gd|gd2
the exstension of saved files
Can be modified in the Tk interface
-quality|jpegquality 0-100
the quality of the file used by GD when saving the
+ current
photo in jpeg format
An empty value let GD to choose a good default
Can be modified in the Tk interface
-pngcompression 0-9
the compression factor used by GD when saving the
+current
photo in png format
-dateformat|df string
the format used for dates. It defaults to %Y_%m_%d
+_%H_%M_%S
in such way resulting pics can be ordered correctl
+y.
See C<strftime> in L<POSIX> to more hints about fo
+rmatting.
=head1 DESCRIPTION
The program is aimed to let you to easely choose among photos and save
+ one (or
more) copy in the preferred format (jpg as default; gif png gd and gd2
+ are also
available). The name of the copy is crafted using the timestamp when t
+he photo
was taken.
Basically the program will load all jpg files found globbing the path
+given with
command line parameter C<-source> or entered in the graphical interfac
+e,
and foreach file will examine some exif tags to get sizes, timestamps
+and the
thumbnail (if not present showing a black empty one).
Orientation of the image is handled automatically for thumbnails and m
+ain photo.
Advanced options are available to manipulate how many photos are copie
+d, in which
format and let you to postprocess via C<exiftool> each created image.
The program uses L<GD> for image manipulation and L<Image::ExifTool> t
+o load infos
from photos and in the postprocess of them.
=head1 THE GRAPHICAL INTERFACE
A main control window and a display one are created. Optionally a thir
+d window
is created to access the advanced copy options. The display window ten
+ds to take
the focus being the program focused on displaying photos.
=head3 control window
The control window contains:
=over
=item *
all controls to manipulate the photo list (C<'browse'> C<'new list'> C
+<'view list'> C<'add to list'> and C<'clear list'>)
Note the that the C<'browse'> does not fill the list; you need to use
+C<'new list'> or C<'add to list'> after using it.
=item *
an entry to choose the destination folder (that will be checked for ex
+istence)
=item *
the C<photo ratio> and the C<window ratio> controls and the C<debug> s
+witch
=item *
an informative text about the current displayed photo or about the gri
+d of thumbnails
=item *
the editable name of the current photo (and an eventual suffix) used t
+o save it
=item *
an information text about the status of the main program (with only re
+levant information
about copying and loading operations as eventual errors)
=item *
the C<save> button and the C<advanced> options one.
=item *
controls to navigate the photo list
=back
=head3 display window
The display window will starts showing a grid of thumbnails. The first
+ one
is selected. You can navigate the grid using C<right arrow> and C<left
+ arrow> of
the keyboard to move the current selection on or back.
C<up arrow> and C<down arrow> let you load previous or next grids of t
+humbanails.
C<Enter> key will open the currently selected thumbanil in a bigger re
+solution (
determinted by C<photo ratio> parameter) photo filling the whole windo
+w.
When just one photo is displayed C<right arrow> and C<left arrow> of t
+he keyboard
can be used to show next and previous photo while C<up arrow> and C<do
+wn arrow>
bring you back to the thumbnail view.
In both control and display window C<space bar> can be used to save th
+e current
photo and C<p> key can be used to toggle autoplay. If autoplay is acti
+ve the time
between photos can be set in the control window. Please note that spec
+ifying a
short amount of time (shorter than the time needed to load photos data
+) can
produce weird showing behaviours.
=head3 advanced copy options
This menu lets you to have a granular control about how original photo
+ will be
copied.
The C<allow overwrite> if checked silently overwrite a photo wich has
+the same
name of what is composed for the current one.
C<bypass original file elaboration (simple copy)> make a copy of the o
+riginal file
using the new name but without processing it with L<GD>
C<output file type> lets you to choose among different file fomrmats (
+jpeg, gif,
png, gd and gd2) and to set the quality (0-100) for jpeg ones.
For png files the compression factor (0-9) can be specified only via t
+he command
line parameter C<-pngcompression>
C<enable multiple copies> is trickier. If enabled lets you to choose t
+o copy the
file many times, each one with a different resolution. In the C<multi
+copies pattern>
you can specify different resolutions in the format widthxheigth as in
+ 800x600 or
1024x768 and for each format a copy will be created.
C<enable post processing> can be used to postprocess every image with
+C<exiftool>
program that ships with L<Image::ExifTool> module. You can use alterna
+tive program
to postprocess your image inserting the full path in the C<program> fi
+eld.
Arguments to such program can be also specified where C<$> can be use
+d to refer
to the full path of the original image. In the C<exiftool> command lin
+e you can
also specify C<@> to refer to the current file.
So you can postprocess every copy using the following arguments:
C<-overwrite_original -all= -tagsFromFile $ -ImageSize -ImageWidth -Im
+ageHeight -ThumbnailImage -Orientation -DateTimeOriginal>
This C<exiftool> command will be issued for every copy made, overwriti
+ng each exif
tags in the copy, removing them all but taking some tag frome the orig
+inal file
and applying them to the copy. See the L<exiftool> page for a lot of o
+ptions
this wonderful program lets you to use.
=head1 LIMITATIONS
The program was tested against few different camera formats; i dont kn
+ow if exif
tags extracted are widely valid.
The autoplay feature does not plays well with little time intervals: i
+nfact when
the interval is smaller than the overall time taken to load the the ph
+oto and to
redesign the display i'll notice photos and information skipped and th
+e timer
going on. I tried fixing this using C<waitVisibility> Tk method, with
+no luck.
=head1 COPYRIGHT
This software and icons are copyright of Discipulus as found on www.pe
+rlmonks.org
You may redistribute or modify it under the same term of Perl itself.
=cut
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.