Subject: | Enable .mov and .avi support (with patch) |
The attached patch introduces support for mov and avi files, as found on
some cameras. Basically I just set the T_MPG type for all files ending
with these suffixes.
And while I was at it, I fixed a warning when --medium was not set.
Regards,
Slaven
Subject: | album-mov.patch |
#
#
# To apply this patch:
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'applypatch' program with this patch file as input.
#
# If you do not have 'applypatch', it is part of the 'makepatch' package
# that you can fetch from the Comprehensive Perl Archive Network:
# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
# In the above URL, 'x' should be 2 or higher.
#
# To apply this patch without the use of 'applypatch':
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'patch' program with this file as input.
#
#### End of Preamble ####
#### Patch data follows ####
diff -up '../build/Album-1.03/script/album' 'Album-1.03/script/album'
Index: ./script/album
Prereq: 1.82
--- ./script/album Thu Sep 21 15:42:19 2006
+++ ./script/album Thu Oct 19 00:51:10 2006
@@ -89,7 +89,7 @@ use constant DEFAULTS => { info =>
my $TMPDIR = $ENV{TMPDIR} || $ENV{TEMP} || '/usr/tmp';
-my $suffixpat = qr{\.(?:jpe?g|png|gif|mpg)}i;
+my $suffixpat = qr{\.(?:jpe?g|png|gif|mpg|mov|avi)}i;
my %capfun = ('c' => \&c_caption,
'f' => \&f_caption,
@@ -350,7 +350,10 @@ sub set_defaults {
setopt("icon", DEFAULTS->{icon});
$medium = DEFAULTS->{mediumsize} if defined($medium) && !$medium || $mediumonly;
- $medium = 0 if $medium < 0;
+ {
+ no warnings 'uninitialized';
+ $medium = 0 if $medium < 0;
+ }
# Caption values.
setopt("caption", DEFAULTS->{( -s $info_file || $import_dir) ?
@@ -468,7 +471,7 @@ sub load_info {
$el->description($a) if $a;
$el->tag($tag) if $tag;
$el->_rotation($rotate) if defined($rotate);
- if ( $file =~ /^(.+)\.mpg$/i ) {
+ if ( $file =~ /^(.+)\.(?:mpg|mov|avi)$/i ) {
$el->type(T_MPG);
$el->assoc_name($1."s.jpg"); # associates still image
}
@@ -609,7 +612,7 @@ sub load_info_journal {
}
$el->_rotation($rotate) if defined($rotate);
- if ( $file =~ /^(.+)\.mpg$/i ) {
+ if ( $file =~ /^(.+)\.(?:mpg|mov|avi)$/i ) {
$el->type(T_MPG);
$el->assoc_name($1."s.jpg"); # associates still image
}
@@ -683,7 +686,7 @@ sub load_files {
warn(d_large($f).": Changed to VOICE\n") if $verbose;
}
}
- elsif ( $f =~ /^(.+)\.mpg$/ ) {
+ elsif ( $f =~ /^(.+)\.(?:mpg|mov|avi)$/i ) {
$el->type(T_MPG);
my $assoc = $1."s.jpg";
$el->assoc_name($assoc);
@@ -714,7 +717,7 @@ sub load_import {
}
else {
$el->type(T_JPG);
- if ( $f =~ /^(.+)\.mpg$/i ) {
+ if ( $f =~ /^(.+)\.(?:mpg|mov|avi)$/i ) {
$el->type(T_MPG);
$el->assoc_name($1."s.jpg");
}
#### End of Patch data ####
#### ApplyPatch data follows ####
# Data version : 1.0
# Date generated : Thu Oct 19 00:51:31 2006
# Generated by : makepatch 2.03
# Recurse directories : Yes
# Excluded files : (\A|/).*\~\Z
# (\A|/).*\.a\Z
# (\A|/).*\.bak\Z
# (\A|/).*\.BAK\Z
# (\A|/).*\.elc\Z
# (\A|/).*\.exe\Z
# (\A|/).*\.gz\Z
# (\A|/).*\.ln\Z
# (\A|/).*\.o\Z
# (\A|/).*\.obj\Z
# (\A|/).*\.olb\Z
# (\A|/).*\.old\Z
# (\A|/).*\.orig\Z
# (\A|/).*\.rej\Z
# (\A|/).*\.so\Z
# (\A|/).*\.Z\Z
# (\A|/)\.del\-.*\Z
# (\A|/)\.make\.state\Z
# (\A|/)\.nse_depinfo\Z
# (\A|/)core\Z
# (\A|/)tags\Z
# (\A|/)TAGS\Z
# p 'script/album' 87631 1161211870 0100755
#### End of ApplyPatch data ####
#### End of Patch kit [created: Thu Oct 19 00:51:31 2006] ####
#### Patch checksum: 96 3177 12188 ####
#### Checksum: 114 3801 63724 ####