Page 1 of 1

'Argument $x isn't numeric in subroutine entry'?

Posted: 2009-07-09T12:38:00-07:00
by evank
I'm following up on some distributed testing errors on a CPAN module I'm working on, and I've isolated the following errors to these corresponding Composite method calls:

Code: Select all

# Argument "Multiply" isn't numeric in subroutine entry at [...] line 89.
$output_file->Composite('image' => $plot_file, 'compose' => 'Multiply', 'x' => $x, 'y' => $y );

# Argument "Blend" isn't numeric in subroutine entry at [...] line 112.
$input_file->Composite('image' => $output_file, 'compose' => 'Blend', 'blend' => $parent->get_opacity() . '%');
Apparently, this (probably very old) version of PerlMagick is expecting the compose key to have an integer value rather than a string...Are there constants for Multiply and Blend somewhere in the PerlMagick codebase that I should be providing in those method calls? If so, where?

Re: 'Argument $x isn't numeric in subroutine entry'?

Posted: 2009-07-09T13:05:12-07:00
by magick
The image parameter requires an image handle. For example,

Code: Select all

use Image::Magick;

$logo = Image::Magick->New();
$logo->Read('logo:');
$rose = Image::Magick->New();
$rose->Read('rose:');
$logo->Composite('image' => $rose, 'compose' => 'Blend', 'x' => 10, 'y' => 20 );

Re: 'Argument $x isn't numeric in subroutine entry'?

Posted: 2009-07-09T13:28:34-07:00
by evank
I didn't specifically show it, but both $plot_file and $output_file are open image handles. To clarify, this code works fine on my own dev box, and on the others in the distributed testing farm, except for that particular one.

I was just wondering if anyone has seen this before, or would have insight into it.