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

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
evank

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

Post 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?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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 );
evank

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

Post 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.
Post Reply