help needed: batch conversion stops/probably /dev/null

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
el noe

help needed: batch conversion stops/probably /dev/null

Post by el noe »

Hi,

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;
   }
Server output:

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
I just found

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`;
...
but there is still an overflow till 100% is reached.
It looks like either I have some mistake and the temporary path is not used or something else stuffs /dev/null

Regards

Niko
el noe

Re: help needed: batch conversion stops/probably /dev/null

Post by el noe »

o.k. it seems to work.

I changed

Code: Select all

-define registry:temporary-path
to

Code: Select all

-set registry:temporary-path
Regards

Niko
el noe

Re: help needed: batch conversion stops/probably /dev/null

Post by el noe »

:( Just looked this one up in the dictionary:
Don't halloo till you're out of the wood!
set does not work as expected there is no conversion taking place.

So still I appreciate any help.

Regards

Niko
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: help needed: batch conversion stops/probably /dev/null

Post by el_supremo »

I don't understand how your /dev/null can fill up nor how it can be mounted on /tmp.
/dev/null is a special device which when written to just throws away the data. It does not store it anywhere.

Something appears to be wrong with how /dev/null has been set up on your system.

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
el noe

Re: help needed: batch conversion stops/probably /dev/null

Post by el noe »

Hello el_supremo,

thank you for your reply. There might be some misconfiguration but I think there is not. It is a Managed server from a big hosting company and even though there might be mistakes as well I hope they know what they do.

I removed one specieal folder from my loop and now it works.
The biggest file in this folder is 1,63 MB and there are 167 files.
I tried every single file and there are two files causing the problem.
One works with identify the other does not.

Code: Select all

10_excellence_tizio.jpg JPEG 6000x4256 DirectClass 1.1mb 1.730u 0:11
Probably this file is too big.
The second is 548 kb but has a size of 4532x7802
Probably the problem is the size of /dev/null but I cannot get the

Code: Select all

-define registry:temporary-path=...
command get to work. It looks like it is ignored with ImageMagick 6.2.4 02/10/07

Regards

Niko
Post Reply