Album
view release on metacpan or search on metacpan
script/album view on Meta::CPAN
239023912392239323942395239623972398239924002401240224032404240524062407240824092410
$line
.=
" "
x (8-
length
(
$line
)%8) .
shift
(
@l
)
while
@l
;
$line
;
}
################ Copying: plain files ################
sub
copy {
my
(
$orig
,
$new
,
$time
) =
@_
;
$time
= (
stat
(
$orig
))[9]
unless
defined
(
$time
);
my
$in
=
do
{
local
*F
;
*F
};
open
(
$in
,
"<"
,
$orig
) or
die
(
"$orig: $!\n"
);
binmode
(
$in
);
my
$out
=
do
{
local
*F
;
*F
};
open
(
$out
,
">"
,
$new
) or
die
(
"$new: $!\n"
);
binmode
(
$out
);
my
$buf
;
script/album view on Meta::CPAN
242124222423242424252426242724282429243024312432243324342435243624372438243924402441
}
close
(
$in
);
close
(
$out
) or
die
(
"$new: $!\n"
);
utime
(
$time
,
$time
,
$new
);
}
################ Copying: MPG files ################
sub
copy_mpg {
my
(
$orig
,
$new
,
$time
,
$rotate
,
$mirror
) =
@_
;
$time
= (
stat
(
$orig
))[9]
unless
defined
(
$time
);
# I'm not sure what this does. The resultant file is about 10% of
# the original, without missing something...
my
$cmd
=
"$prog_mencoder -of mpeg -oac copy -ovc "
.
(
$rotate
?
"lavc -lavcopts vcodec=mpeg1video -vop rotate="
.
int
(
$rotate
/90).
" "
:
"copy "
) .
squote(
$orig
) .
" -o "
. squote(
$new
);
warn
(
"\n+ $cmd\n"
)
if
$verbose
> 2;
my
$res
= `
$cmd
2>&1`;
die
(
"${res}Aborted\n"
)
if
$?;
script/album view on Meta::CPAN
252125222523252425252526252725282529253025312532253325342535253625372538253925402541
$canvas
->Write(
$new
);
my
$time
=
$el
->timestamp;
utime
(
$time
,
$time
,
$new
);
$canvas
;
}
################ Copying: Voice files ################
sub
copy_voice {
my
(
$orig
,
$new
,
$time
) =
@_
;
$time
= (
stat
(
$orig
))[9]
unless
defined
(
$time
);
$orig
=~ s/\.\w+$/.mpg/;
return
if
-s
$new
;
return
unless
$prog_mplayer
;
# This will produce an MP2 file. Good enough for now...
my
$cmd
=
"$prog_mplayer -nojoystick -nolirc -vo null "
.
"-dumpaudio -dumpfile "
. squote(
$new
) .
" "
. squote(
$orig
);
warn
(
"\n+ $cmd\n"
)
if
$trace
;
my
$res
= `
$cmd
2>&1`;
die
(
"${res}Aborted\n"
)
if
$?;
script/album view on Meta::CPAN
274327442745274627472748274927502751275227532754275527562757275827592760276127622763my
$self
= {
$file
?
(
orig_name
=>
$file
,
dest_name
=> basename_nolarge(
$file
)) : (),
description
=>
""
,
annotation
=> [],
tag
=>
""
,
};
if
(
$file
&& -f
$file
) {
my
@st
=
stat
(_);
my
$ii
= ::cache_entry(
$file
);
if
(
$ii
){
$self
=
$ii
;
delete
(
$self
->{
$_
})
foreach
grep
{ /^_/ }
keys
(
%$self
);
}
# Else, get image info.
else
{
my
$ii
= Image::Info::image_info(
$file
);
$self
->{file_size} =
$st
[7];
( run in 0.535 second using v1.01-cache-2.11-cpan-5f2e87ce722 )