Album

 view release on metacpan or  search on metacpan

script/album  view on Meta::CPAN

2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
    $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

2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
    }
    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

2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
    $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

2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
my $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 )