use Data::Dump qw( dump );
use JSON;
use Clone qw( clone );
+use autodie;
use utf8;
my $json;
foreach my $i ( @$aoh ) {
- my $source = sprintf( "ZBIRKA-NEOLITIK/%02d.png", $i->{ID} );
+ my $source = sprintf( "../ZBIRKA-NEOLITIK/%d.png", $i->{ID} );
my $image = sprintf( "image/%d.jpg" , $i->{ID} );
my $thumb = sprintf( "thumb/%d.jpg" , $i->{ID} );
- system "convert -trim $source $image";
- system "convert -geometry 100x $image $thumb";
+
+ if ( ! -e $source ) {
+ warn "ERROR: no image $source";
+ next;
+ }
+
+ system "convert -trim -geometry 400x $source $image";
+ #system "convert $image -scale 100x100 -gravity center -background white -extent 100x100 $thumb";
+ system qq{convert $source -fill white -draw "color 1,1 floodfill" -scale 100x100 -gravity center -background white -extent 100x100 $thumb};
$i->{image} = $image;
$i->{thumbnail} = $thumb;
# $i->{label} = $i->{opis_predmeta};