+ $path .= '/' . $factor;
+
+ if ( ! -d $path ) {
+ mkdir $path;
+ warn "created $path\n";
+
+ }
+
+ foreach my $hires ( @slides_hires ) {
+
+ my $nr = $1 if $hires =~ m{(\d+)\.\w+$} || warn "can't find number in $hires";
+ next unless $nr;
+ my $file = slide_jpg( $factor => $nr );
+ warn "slide $hires -> $file\n";
+# next if -e $file;
+
+ my $im = Graphics::Magick->new;
+ $im->ReadImage( $hires );
+ $im->Resize( width => $w, height => $h, filter => 13, blur => 0.9 );
+ my $c = $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 );