I discovered ImageMagick and I am really happy about it. I just stepped into a problem with bulk conversion. There are some thousand images and after about five minutes the /dev/null on the server is 100% full and the conversion stops. The conversion is a perl script which calls ImageMagick.
There is a source file and three destinations files -small -medium with watermark -large with watermark
The /dev/null issue is the only thing which looks like a problem to me. I would appreciate any help or hint which could lead to a solution.
Code: Select all
opendir (DIR, "./") || exit(&MP::GLOBALS::logfile('mds_3','Fehler'));
my @folder;
while (defined($_ = readdir(DIR))) {next if $_ eq "."; next if $_ eq ".."; if (-d "./" . $_) {push (@folder,$_);}}
foreach $_ (@folder) {
opendir(DIR, "./" . $_ . "/quelle");
while( my $filename = readdir DIR ){
next unless $filename =~ /.jpg$/;
next if $filename =~ /\s/;
$command = `identify ./$_/quelle/$filename 2>&1`;
print $command;
next if $command =~ /no image/;
unless (-e "./" . $_ . "/klein/" . $filename) {
$command = `convert ./$_/quelle/$filename -resize 75x45\> \-size 75x45 xc:white +swap -gravity center -composite \\./$_/klein/$filename 2>&1`;
print $command;
}
unless (-e "./" . $_ . "/mittel/" . $filename) {
$command = `convert ./$_/quelle/$filename -resize 300x180\> \-size 300x180 xc:white +swap -gravity center -composite \\./$_/mittel/$filename 2>&1`;
$command = `composite -dissolve 15 -gravity north ./watermark.png ./$_/mittel/$filename ./$_/mittel/$filename 2>&1`;
}
unless (-e "./" . $_ . "/gross/" . $filename) {
$command = `convert ./$_/quelle/$filename -resize 600x360\> \-size 600x360 xc:white +swap -gravity center -composite \\./$_/gross/$filename 2>&1`;
$command = `composite -dissolve 15 -gravity north ./watermark.png ./$_/gross/$filename ./$_/gross/$filename 2>&1`;
}
print ".";
}
closedir DIR;
}
Code: Select all
Filesystem Size Used Avail Use% Mounted on
/dev/sda7 1.9G 1.5G 294M 84% /
/dev/sda9 1.4T 104G 1.3T 8% /homepages
/dev/null 235M 235M 20K 100% /tmp
viewtopic.php?f=3&t=12887
and modified convert
Code: Select all
...
$command = `convert -define registry:temporary-path=$my_own_temppath ./$_/quelle/$filename -resize 75x45\> \-size 75x45 xc:white +swap -gravity center -composite \\./$_/klein/$filename 2>&1`;
...
It looks like either I have some mistake and the temporary path is not used or something else stuffs /dev/null
Regards
Niko