Album
view release on metacpan or search on metacpan
Version 1.901.1
Version 1.901.0
Version 1.7.2
Version 1.7.1
Version 1.7.0
* Resolve CPAN numbering conflicts.
Version 1.07
* Added primary index in top dir, plus associates style sheets and
format (key: main). Added background image.
* 'album' will no longer write external stylesheets by default. Use
--extcss to initally create the external style sheets.
* When using external style sheets or formats, 'album' will verify
that the style sheets match the formats by checking the VERSION
lines.
* Index pages are now written in subdirectory index/ , and numbered
index0001.html and so on.
* The thumbnails are moved from thumbnails/ to index/ . The
thumbnails/ directory is no longer used.
A quick way to migrate an existing album is to remove all
index*.html pages, and rename the thumbnails/ directory to index/ .
(And, probably, remove the css/ directory as well.)
#### WARNING: INCOMPATIBLE CHANGE ####
Almost all of the formatting has been moved to the style sheets.
As a consequence, newly generated pages will probably not look as
they should if you have style sheets from a previous version of
album.
Album now verifies that existing style sheets start with a line:
/* ALBUM-CSS-VERSION: 1.0 */
If this line is missing (as is the case with older style sheets), or
the version number is not compatible with this version of album, a
fatal error is given and the program terminates.
Should you run into this situation (which is likely to occur once
for every existing album), then move the style sheets to a backup
location, run album, and re-apply your changes (if any) to the new
style sheets.
#### END INCOMPATIBLE CHANGE ####
* 'info.dat' may now designate its encoding system, if needed:
# -*- coding: utf-8 -*-
#### WARNING: INCOMPATIBLE CHANGE ####
* Medium sized images will not be resized if the original (large)
* Mencoder now seems to need '-vf' instead of '-vop'. Bye bye
compatibility. However, this only affects rotation of movies.
* Tutorial: Document keyboard navigation.
* Tutorial: Document external formats (**EXPERIMENTAL**).
* Tutorial: Document journal (**EXPERIMENTAL**).
* Change HTML for journal pages: now requires style sheet to (v)align
the cells.
Version 1.06,
* Hide in-line uuencoded material from prying eyes of stupid POD
converters.
Version 1.05,
* Several file naming fixes for Windows. Thanks to Slaven Rezic and
- Silence many warnings and info from mplayer.
- Output HTML entities for non-ascii characters. Use Latin-9 instead
of Latin-1.
Version 1.02, Unreleased
Version 1.01, Sun Nov 21 11:29:10 CET 2004
* Album now uses style sheets (CSS) for most formatting, making
it easy to customize the appearance of the pages.
Version 1.00, Sun Oct 3 16:40:34 CET 2004
* First official release after a long period of beta tests.
extract audio from VOICE files.
If missing, no stills will be produced, and VOICE files
will remain silent.
# Migrating from Version 1
The structure and content of the files have changed from version 1 in
an INCOMPATIBLE way. Hopefully, the version 2 approach will be
flexible enough to last longer.
If you didn't change any style sheets, migration is easy:
- remove all `index*.html` files
- remove the `css` directory, with contents
- rename the `thumbnails` directory to `index`
If you did change style sheets:
- remove all `index*.html` files
- move the `css` directory, with contents, to a backup location
- rename the `thumbnails` directory to `index`
- run `album` with `--extcss` once
- apply your style sheet changes to the new style sheets
lib/Album/Tutorial.pm view on Meta::CPAN
included literally.
The medium and large image pages have an additional icon to jump to
the journal entry for an image. The extended text can be also viewed
on the medium and large image pages when the mouse is placed over the
info at the right side above the image, e.g., C<My First Album: Image
1 of 9>.
Note that journal mode can not be mixed with normal mode.
=head2 External formats and style sheets
I<Warning: External formats and style sheets are still under
development and may change in future versions.>
Internally, 'album' uses formats (templates) to build the generated
HTML pages, and cascading style sheets (CSS) to specify how the
browser should show the pages. Formats and style sheets can be
exported (written to external directories), and 'album' will then use
the external information. So you can have ultimate control over how
pages must look like.
=head2 External formats
When 'album' is run with B<--extformats> it will create a directory
'formats' and, in this directory, the HTML templates for all types of
pages that 'album' will generate. Existing files in this directory
will B<not> be overwritten, so it is safe to change the templates to
lib/Album/Tutorial.pm view on Meta::CPAN
substituted with actual values. Some of the variables are:
=over 12
=item $title
The title of the album.
=item $css
The code to get the style sheet of this page. This can be in-line
specifications, or a link to an external stylesheet.
=item $ltop
Index and image pages only: The text above each image, left.
=item $rtop
Index and image pages only: The text above each image, right.
=item $vbuttons
lib/Album/Tutorial.pm view on Meta::CPAN
=item $tag
Journal pages only: The tag for this page.
=item $journal
Journal pages only: The journal for this page.
=back
=head3 External style sheets
When 'album' is run with B<--extcss> it will create a directory 'css'
and, in this directory, the css style sheets for all types of pages
that 'album' will generate. Existing files in this directory will
B<not> be overwritten, so it is safe to change the templates to your
liking. When 'album' is run again to process images, it will use the
external style sheets if they are available.
To obtain good results, the style sheets must match the formats.
'album' will try to verify this by reading the first line of the style
sheets and the formats, and verify that it contains a version
indication of the form
ALBUM-FMT-VERSION: <major>.<minor> (for formats)
ALBUM-CSS-VERSION: <major>.<minor> (for style sheets)
For all style sheet - format pairs, the major numbers must be the
same.
Older versions of 'album' always created external style sheets. As a
consequence, if you upgrade to the newer version, you'll get a fatal
error the first time you run 'album'.
*************************************************************************
Existing style sheet ... is not compatible with this version.
It has probably been created by an older version of this program, or it
has been modified manually.
If you did not change any style sheets, just remove the css directory and
try again.
If you did modify the style sheets move them away to a backup location,
run the program with '--extcss', and apply your changes to the new style
sheets.
*************************************************************************
We apologise for the inconvenience.
=head2 Keyboard navigation
While browsing the album, some actions can be performed from the keyboard.
The C<Enter> key will go to an enlarged version of the image, if available.
script/album view on Meta::CPAN
# Cleanup excess files.
for (my $i = $num_entries ; ; $i++ ) {
my $excess = $fn++ . ".html";
unlink(d_medium($excess));
unlink(d_large($excess)) or last;
}
# Copy the button images over to the target directory.
add_button_images();
# Init formats and stylesheets.
init_formats();
init_stylesheets();
# Write the individual pages.
write_image_pages();
# Write the index pages.
write_index_pages();
# Write the journal.
write_journal_pages();
script/album view on Meta::CPAN
my ($fmt, %map) = @_;
# THIS DOES ONLY ONE SUBST PER LINE
$fmt =~ s/^(.*?)\$(\w+)\b/$1.indent($map{$2}, length($1))/gme;
$fmt;
}
################ Style Sheets ################
my %css_for;
sub init_stylesheets {
my $css_fontfam = "font-family: Verdana, Arial, Helvetica";
my $WHITE = "#FFFFFF";
my $BLACK = "#000000";
my $RED = "#FF0000";
my $LGREY = "#E0E0E0";
my $MGREY = "#D0D0D0";
my $DGREY = "#C0C0C0";
my $DDGREY = "#B0B0B0";
my $BLUE = "#0000FF";
script/album view on Meta::CPAN
my $major = $css_major;
my $minor = $css_minor;
my $orig;
if ( open(my $orig, "<", d_fmt("$req.fmt")) ) {
my $line = <$orig>;
close($orig);
if ( $line =~ m;/\*\s*album-fmt-version:\s*(\d+)\.(\d+)\s*\*/;i ) {
($major, $minor) = ($1, $2);
}
}
# Check stylesheet compatibility.
open($orig, "<", $css);
my $line = <$orig>;
close($orig);
if ( $line =~ m;/\*\s*album-css-version:\s*(\d+)\.(\d+)\s*\*/;i ) {
if ( $1 == $major ) {
return "";
}
}
print STDERR "\n" if $did;
die(heredoc(<<" EOD", 8));
*************************************************************************
Existing style sheet $req.css is not compatible with this version.
It has probably been created by an older version of this program, or it
has been modified manually.
If you did not change any style sheets, just remove the css directory and
try again.
If you did modify the style sheets move them away to a backup location,
run the program with '--extcss', and apply your changes to the new style
sheets.
*************************************************************************
EOD
}
elsif ( $externalize_css ) {
unless ( $did ) {
my $fdir = d_css("");
$fdir =~ s/\/+$//;
unless ( -d $fdir ) {
print STDERR ("mkdir $fdir\n");
mkdir(d_css(""));
}
}
print STDERR ("Creating stylesheets: ") if $verbose > 1 && !$did++;
print STDERR ("$req ") if $verbose > 1;
open (my $fh, '>', $css) || die("$css: $!\n");
print { $fh } $data;
close($fh);
}
$data =~ s/^([ \t]+)/detab($1)/gem;
$data;
};
my $css_for_common = heredoc(<<" EOD", 0);
script/album view on Meta::CPAN
border: 0px; background-color: $MGREY; color: $BLACK;
text-align: center;
}
a.info span {
display: none;
}
table.outer {
background: $MGREY;
border-collapse: separate;
border-width: 2px; /* border=2 */
border-style: solid;
border-color: $GR232 $GR114 $GR114 $GR232;
border-spacing: 3px; /* cellspacing = 3 */
}
table.outer tr {
background: $LGREY;
}
table.outer td {
border-width: 1px;
border-style: solid;
border-color: $GR124 $GR245 $GR245 $GR124;
}
table.inner {
/* need a width otherwise we cannot center it */
width: ${helper}px;
border: outset 0px;
}
table.inner td {
border: inset 0px;
padding: 0 0 0 0;
script/album view on Meta::CPAN
p.indextitle a {
text-decoration: none;
color: $WHITE;
}
EOD
}
sub css_for {
my ($type) = shift(@_);
defined(my $css = $css_for{$type}) or die("PROGRAM ERROR: css_for($type)");
return qq{<link rel="stylesheet" href="}.d_up(d_css($type.".css")).qq{">}
unless $css;
qq{<style type=\"text/css\">\n} . $css . qq{</style>};
}
################ Helpers for Image/Index/Journal pages ################
sub jscript {
my (%nav) = @_;
my $next = $nav{next};
my $prev = $nav{prev};
my $up = $nav{up};
my $down = $nav{down};
script/album view on Meta::CPAN
for ( $med ? $el->medium_size : $el->file_size ) {
next unless $_;
$ret .= "," if $ret;
$ret .= bytes($_);
}
$ret;
}
#### EXIF helpers.
sub restyle_exif($) {
my ($el) = @_;
my $ret = "";
my $v;
my $app = sub {
$ret .= "<tr><td>".htmln($_[0])."</td>".
"<td>".htmln($_[1])."</td></tr>\n";
};
$app->("Date", $v) if $v = $el->xDateTime;
script/album view on Meta::CPAN
}
#### Caption helpers.
sub f_caption($) {
my ($el) = @_;
my $s = htmln($el->type == T_REF ? $el->orig_name : $el->dest_name);
if ( $el->Make ) {
$s = " $s<a href='#' class='info'> <span>".
"<table border='1' width='100%'>\n".
restyle_exif($el) . "</table>\n".
"</span></a>";
}
$s;
}
sub s_caption($) {
my ($el) = @_;
size_info($el, $medium);
}
script/album view on Meta::CPAN
my $s = size_info($el);
$auxright .= " ($s)" if $s;
$auxright .= " $creator" if $creator;
my $auxleft = htmln($el->tag || "");
my $it2 = $it;
if ( $el->Make ) { # EXIF info
$it2 = "<a href='#' class='info'>" . ($it || " ") .
"<span>" .
"<table border='1' width='100%'>\n" .
restyle_exif($el) . "</table>\n" .
"</span></a>";
}
my $tt2 = $tt;
if ( $dir eq "medium" && $el->annotation ) {
my @a = UNIVERSAL::isa($el->annotation, "ARRAY")
? @{$el->annotation} : ($el->annotation);
my $t = "";
foreach ( reverse(@{$el->annotation}) ) {
next unless $_;
script/album view on Meta::CPAN
--mediumsize NNN the max size of medium sized images, default @{[DEFAULTS->{mediumsize}]}
--mediumonly ignore large images and links (for web export)
Importing:
--import XXX original images
--exif use w/ EXIF info, if possible
--dcim XXX as --import with --exif
--update add new entries from import, if needed
--[no]link [do not] link to original, instead of copying. Default is link.
Miscellaneous:
--clobber recreate everything (except large)
--clobbercss recreate (overwrite) style sheets
--select=XXX select images (default, all, hidden, tag:...)
--test verify only
--help this message
--ident show identification
--verbose verbose information
EndOfUsage
exit $exit if defined $exit && $exit != 0;
}
sub set_selector {
( run in 2.193 seconds using v1.01-cache-2.11-cpan-a49fcb8fa48 )