Page 1 of 1

convert output changed V6.2.8-4 -> v6.5.6-9

Posted: 2009-10-07T16:35:50-07:00
by wpns
I've got a Centos-5.3 box (based on a vmlinuz-2.6.18-128.1.10.el5 kernel), and trying to run some Perl code I had running on a different box.

My code does essentially:
$commandstring = sprintf("compare -metric PSNR /home/Movies/FD%04i.jpg /home/Movies/FD%04i.jpg null:",$counter,$counter-1);
print $commandstring . "\n";
$DiffString = `$commandstring`;
print "/" . $DiffString . "/\n";
($DiffNum) = $DiffString =~ /(\d+(?:\.\d+)?)/;
print "[" . $DiffNum . "]";

With the latest release (v6.5.6-9) on the new box, $DiffString was <BLANK>, so I never pulled a number out of it.

When I found the rpms for 6.2.8-4, which was running on the old box just fine, and downgraded to that, my code started working again.

I can see the SNR number when I run the command from the command line, and I'd be happy to have just that, but the SNR number doesn't make it into $DiffString.

Is there something special you have to do to ensure the backtick operator picks up the output of convert? Did something change between 6.2.8-4 and 6.5.6-9?

Am I missing details which might help solve this problem?

Thanks!

Re: convert output changed V6.2.8-4 -> v6.5.6-9

Posted: 2009-10-07T19:01:23-07:00
by magick
Try redirecting standard error to standard out (.e.g >/dev/null 2>&1).

Re: convert output changed V6.2.8-4 -> v6.5.6-9

Posted: 2009-10-09T07:40:16-07:00
by wpns
Yup, that worked, at least when I did:

$commandstring = sprintf("compare -metric PSNR /home/Movies/FD%04i.jpg /home/Movies/FD%04i.jpg null: 2>&1",$counter,$counter-1);

is this a bug, will it get fixed, or is the output supposed to goto stderr?

Thanks for the quick response!

Re: convert output changed V6.2.8-4 -> v6.5.6-9

Posted: 2009-10-09T07:50:21-07:00
by magick
The output is supposed to go to standard error to permit an image to standard out:
  • compare -metric rmse image.png reference.png -