[Solved] Composite fail: 410: reference is not my type `Imag
Posted: 2014-06-12T07:50:20-07:00
I've looked and head banged this extensively, so now I'm asking for help. Seems that I cannot predict, thus cannot rely on, which parts of the documentation are going to work as advertised. So far, for me and my efforts, Label does not work, and now Composite does not work. This post relates to Composite.
Here's the test script:
And here is the error I get when it is run:
The test files are a 300x300 white box, and a 300x300 transparent box with a black spot in the middle. I am trying to put the spot on the white background. What I get instead is this error message. This is not the only time Composite has failed. I have been trying to incorporate it into a production script, but cannot, because it does not work at all, according to my attempts based on available documentation.
I've looked for good books on ImageMagick, and there are not any "good" books. I think this is because even those who attempt to write such a book find the project itself too un-documented, or worse, incorrectly documented, to research and report useful reliable information. The point I am making, at least to myself, is that I am not alone in this frustration. That and that I have really tried to find out why Composite is failing.
Your help is needed and appreciated.
David
Here's the test script:
Code: Select all
#!/usr/bin/env perl
# perl-jsiiw-Composite.pl: trying to get im's Composite method to work.
use strict;
use warnings;
use Image::Magick;
my ($doll, $t, $coal, $w);
# These are 300x300px pngs from gimp. the black-dot is transparent, except
# for the dot. Ideally, this puts the dot on the white destination png.
$doll = "./white-box-300x300.png";
$t = "./black-dot-300x300.png";
$coal = Image::Magick->new;
$w = $coal->Read("$doll");
warn $w if $w;
$w = $coal->Composite(image=>"$t", compose=>'over', geometry=>"+4+4", gravity=>'center'); # Line 20.
warn $w if $w;
$w = $coal->Write("./blackdot.png");
warn $w if $w;
Even when I reduce the method to just reading the image, it fails with that message. Funny though, if I feed it a () it gives:Exception 410: reference is not my type `Image::Magick' @ error/Magick.xs/XS_Image__Magick_Mogrify/7505 at /home/david/bin/perl-jsiiw-Composite.pl line 20.
so at least this indicates that the $coal->Composite() method does exist, or else it would not be there to complain. (?)Exception 410: composite image required `Image::Magick' @ error/Magick.xs/XS_Image__Magick_Mogrify/8279 at /home/david/bin/perl-jsiiw-Composite.pl line 23.
The test files are a 300x300 white box, and a 300x300 transparent box with a black spot in the middle. I am trying to put the spot on the white background. What I get instead is this error message. This is not the only time Composite has failed. I have been trying to incorporate it into a production script, but cannot, because it does not work at all, according to my attempts based on available documentation.
I've looked for good books on ImageMagick, and there are not any "good" books. I think this is because even those who attempt to write such a book find the project itself too un-documented, or worse, incorrectly documented, to research and report useful reliable information. The point I am making, at least to myself, is that I am not alone in this frustration. That and that I have really tried to find out why Composite is failing.
Your help is needed and appreciated.
David