- if ( $factor == $slide_factor ) {
- my $im = Imager->new( file => "$path/p001.jpg" );
- $slide_width = $im->getwidth;
- $slide_height = $im->getheight;
+ my $file = slide_jpg( $factor => $nr );
+ next if -e $file;
+
+ $min_slide_height = $prop->{height} if $prop->{height} > $min_slide_height;
+
+ my $w = $min_slide_height / $factor * $slide_aspect;
+ my $h = $min_slide_height / $factor;
+
+ warn "slide [$nr] $hires -> ${w}x${h} $file\n";
+
+ $im->Resize( width => $w, height => $h, filter => 13, blur => 0.9 );
+
+ my $c = 1; # $h / 10;
+ my %info = (
+ font => 'Sans', pointsize => $h / 10,
+ #text => "$factor = $w*$h",
+ text => " $nr ",
+ y => $c,
+ x => $c,
+ );
+ #warn "# info ", dump %info;
+ #warn dump $im->QueryFontMetrics( %info );
+ my ($x_ppem, $y_ppem, $ascender, $descender, $width, $height, $max_advance) = $im->QueryFontMetrics( %info );
+ my $background = Graphics::Magick->new( size => $width . 'x' . $height );
+ $background->ReadImage( 'xc:black' );
+ $im->Composite( image => $background, compose => 'Over', x => $c, y => $c, opacity => 75 );
+ $info{y} += $ascender;
+ $im->Annotate( fill => 'yellow', %info );
+ $im->Write( filename => $file );