use warnings;
use strict;
+use autodie;
+
use IPC::Open3 qw(open3);
use IO::Select;
use Data::Dump qw(dump);
push @slide_t, $s->[0];
}
- if ( @frames ) {
- rmdir $_ foreach glob "$media_dir/s/[124]";
- my $hires = "$media_dir/s/hires";
- mkdir $hires unless -e $hires;
-
- oggThumb $movie, "$hires/.f%.jpg", map { $_->[0] } @frames;
-
- foreach my $i ( 0 .. $#frames ) {
- my $from = "$hires/.f$i.jpg";
- my $to = "$hires/f" . $frames[$i]->[1] . '.jpg';
- rename $from, $to || warn "can't rename $from -> $to: $!";
- }
-
- }
-
foreach ( 0 .. $#slide_t ) {
my $slide_nr = $_ + 1;
push @{ $sync->{htmlEvents}->{'#slide'} }, {
};
}
- my @slides_hires = glob "$media_dir/s/hires/*";
- my $path = "$media_dir/s";
+ my $max_slide_height = 480; # XXX
+
+ my $path = "$media_dir/s";
+ my $hires = "$media_dir/s/hires";
if ( ! -d $path ) {
- warn "create slides images in $path";
+ warn "create slides in $path";
mkdir $path;
+ mkdir $hires;
+
+ my $path = "$media_dir/presentation.pdf";
+ $path = $media_dir . '/' . readlink($path) if -l $path;
+
+warn "XX $path";
+
+ if ( -e $path ) {
+ warn "render pdf slides from $path\n";
+ system "pdftoppm -png -r 100 $path $hires/p";
+ }
}
- my $max_slide_height = 480; # XXX
+
+ if ( @frames ) {
+ warn "create slides from video frames";
+ rmdir $_ foreach glob "$media_dir/s/[124]";
+
+ oggThumb $movie, "$hires/.f%.jpg", map { $_->[0] } @frames;
+
+ foreach my $i ( 0 .. $#frames ) {
+ my $from = "$hires/.f$i.jpg";
+ my $to = "$hires/f" . $frames[$i]->[1] . '.jpg';
+ rename $from, $to || warn "can't rename $from -> $to: $!";
+ }
+
+ }
+
+
+ my @slides_hires = glob "$hires/*";
+
foreach my $hires ( @slides_hires ) {