From: Dobrica Pavlinusic Date: Thu, 15 Oct 2009 18:52:01 +0000 (+0200) Subject: more tweaks to switch to factors X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=7c81676d9c58179406192b0b9445a99531552993;p=HTML5TV.git more tweaks to switch to factors --- diff --git a/bin/mplayer.pl b/bin/mplayer.pl index 837d23a..1ad67ec 100755 --- a/bin/mplayer.pl +++ b/bin/mplayer.pl @@ -203,15 +203,20 @@ sub html5tv { mkdir $path; warn "created $path\n"; - foreach my $hires ( @slides_hires ) { + } - my $file = $hires; - $file =~ s{^.+/(p\d+\.\w)}{$path/$1}; + my $path = "$media_dir/s/$factor"; - my $im = Imager->new( file => $hires ); - $im->scale( xpixels => $w, ypixels => $h, type => 'min' )->write( file => $file ); - warn "resized $file ", -s $file, " bytes\n"; - } + foreach my $hires ( @slides_hires ) { + + my $file = $hires; + $file =~ s{(\d+\.\w)$}{$path/$1} || warn "can't rewrite $file"; + warn "slide $hires $file\n"; + next if -e $file; + + my $im = Imager->new( file => $hires ); + $im->scale( xpixels => $w, ypixels => $h, type => 'min' )->write( file => $file ); + warn "resized $file ", -s $file, " bytes\n"; } }