Argument "gravity" 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
johnfl68
Posts: 33
Joined: 2012-07-09T18:31:26-07:00
Authentication code: 13

Argument "gravity" isn't numeric in subroutine entry...

Post by johnfl68 »

Hello:

I am cleaning up some old code in a script, and I had use strict/warnings commented out, so I uncommented them, and then received the following error on a few lines:

Argument "gravity" isn't numeric in subroutine entry at ... line ...

Probably part of why they were commented out.

The code lines are simple, basically centering $otherimage on a SlateGray background:

Code: Select all

# this is the line before the error line
$image->Extent(gravity => 'Center', geometry => '978x550', background => 'SlateGray');
# this line that has the error
$image->Composite(image => $otherimage, qw(compose gravity Center));
To be honest, I think I copied part of this from somewhere else. The code does work, but I think it is the "qw" that is throwing off warnings.
I sort of understand that the qw is kindof a shortcut for compose gravity and Center, but is it defining them with null/undefined?
Not really sure what the long form code would be, because gravity should be set to Center, but not making sense of why it was done the way it was, other than it worked at the time.

If this makes sense to anyone, as to how to correct this, it would be appreciated.

Thanks!
Post Reply