Page 1 of 1

problem with gravity not working

Posted: 2007-12-02T08:06:46-07:00
by notbob
I have 2 servers.
One uses an old version of image::magick (5 something)
One uses 6.2.6.

On the old version, the gravity feature in composite works just fine.
On my 6.2.6 version, it always defaults to the northwest, regardless of the setting.
Since the default for gravity is northwest, it almost makes me think it is not even seeing what I am setting it to. I have tried using the same script that work on the old 5 version, but still no success.

Any suggestions?

Thanks
NB

Re: problem with gravity not working

Posted: 2007-12-03T18:38:20-07:00
by anthony
scripts from v5 often will not work in v6 as you need to do things in the right order. Operator order was a major problem and the cause of lots of issues in IM v5 which was why things changed and the major version number changed.
see IM Examples 'Basics' for more details.

Re: problem with gravity not working

Posted: 2007-12-04T06:25:35-07:00
by notbob
Thanks for the reply. I probably should have added the code I am using:

my $image2 = new Image::Magick;
$image2->Read($copyrightFile);
$q->Composite(image=>$image2, gravity => "SouthEast");


I looked at the examples, and maybe I am missing something that has changed, but I thought the above should work. However, the watermark still shows at Northwest?

If I am doing something wrong, please let me know.
Thanks!
Nb

Re: problem with gravity not working

Posted: 2007-12-04T07:17:04-07:00
by magick
We are using ImageMagick 6.3.7-2, the current release. The following script places the rose in the lower right hand corner of the ImageMagick logo as expected:
  • use Image::Magick;

    my $image = Image::Magick->new;
    $image->Read('logo:');
    my $logo = Image::Magick->new;
    $logo->Read('rose:');
    $image->Composite(image=>$logo, gravity => "SouthEast");
    $image->Display();

Re: problem with gravity not working

Posted: 2007-12-04T14:00:59-07:00
by notbob
Thanks for the posts.
I tried the code listed and it still did not work.
On the server that had version 6.3.5 - I upgraded it to the current version and then it worked.
The current version also works with the code I am using on my old server with version 5.x on it.

Seems to me that there is a bug in version 6.3.5 with composite and gravity, but since it has been addressed in the 6.3.7, I guess it does not matter.

Thanks again!
NB