blob: 1c88a5ebb161e140b68da5d380d500c306515d71 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!/usr/bin/perl
use strict;
use Data::Dumper;
my $gcompris_root_dir = "..";
my $screenshots_dir = "$gcompris_root_dir/docs/screenshots";
my $thumb_size = "130x130";
# First, Get all the boards description files
opendir DIR, $screenshots_dir or die "cannot open dir $screenshots_dir: $!";
my @files = grep { $_ =~ /\.jpg$/} readdir DIR;
closedir DIR;
#-------------------------------------------------------------------------------
foreach my $image (@files) {
# Skip old thumbs
next if ($image =~ m/_small\.jpg/);
my $file = "$screenshots_dir/$image";
(my $thumb = $file) =~ s/\.jpg/_small\.jpg/;
next if (-f "$thumb");
system ("convert -geometry ".$thumb_size.
" -quality 100 $file $thumb") == 0
|| die "Problems with convert: $?\n";
}
exit 0;
|