Problem after update

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
dsl
Posts: 21
Joined: 2008-01-22T15:14:29-07:00

Problem after update

Post by dsl »

Hello, guys.

Please, help me to understand where the problem is.
The problem arised after I've upgraded IM from 6.4.5 to 6.5.6-7.
After that white rectangle appeared on the gif below.

Image

Original image

Image

Here is script which I use to generate this movie.

Code: Select all

#!/usr/bin/perl

use strict;
use Image::Magick;

my $img_orig = Image::Magick->new();;
$img_orig->Read( 'original.jpg' );

my $img = Image::Magick->new( size => $img_orig->Get('width').'x'.$img_orig->Get('height') );
$img->Set( page => $img_orig->Get('width').'x'.$img_orig->Get('height') );
my $maxi = 5;
for(my $i=0; $i<$maxi; $i++){ $img->Read( 'xc:white' ); }

my ($w,$h)  = $img->Get('width','height');

my $img_tmp1 = $img_orig->Clone();
$img_tmp1->Crop( width => int($w/2), height => int($h/2), x => 0, y => 0);
my $img_tmp2 = $img_orig->Clone();
$img_tmp2->Crop( width => int($w/2), height => int($h/2), x => int($w/2), y => 0);
my $img_tmp3 = $img_orig->Clone();
$img_tmp3->Crop( width => int($w/2), height => int($h/2), x => int($w/2), y => int($h/2));
my $img_tmp4 = $img_orig->Clone();
$img_tmp4->Crop( width => int($w/2), height => int($h/2), x => 0, y => int($h/2));

$img->[0] = $img_orig->Clone();

$img->[0]->Set( 'delay' => 120 );
$img->[1]->Set( 'delay' => 30 );
$img->[2]->Set( 'delay' => 30 );
$img->[3]->Set( 'delay' => 30 );
$img->[4]->Set( 'delay' => 30 );

my $koef = $w > $h ? $w*0.02 : $h*0.02;

$img->[1]->Composite( image => $img_tmp1, geometry => '+'.int($w/2 + $koef).'-'.$koef );
$img->[1]->Composite( image => $img_tmp2, geometry => '+'.int($w/2 + $koef).'+'.int($h/2+$koef) );
$img->[1]->Composite( image => $img_tmp3, geometry => '-'.$koef.'+'.int($h/2+$koef) );
$img->[1]->Composite( image => $img_tmp4, geometry => '-'.$koef.'-'.$koef );

$img->[2]->Composite( image => $img_tmp1, geometry => '+'.int($w/2 + $koef).'+'.int($h/2+$koef) );
$img->[2]->Composite( image => $img_tmp2, geometry => '-'.$koef.'+'.int($h/2+$koef) );
$img->[2]->Composite( image => $img_tmp3, geometry => '-'.$koef.'-'.$koef );
$img->[2]->Composite( image => $img_tmp4, geometry => '+'.int($w/2 + $koef).'-'.$koef );

$img->[3]->Composite( image => $img_tmp1, geometry => '-'.$koef.'+'.int($h/2+$koef) );
$img->[3]->Composite( image => $img_tmp2, geometry => '-'.$koef.'-'.$koef );
$img->[3]->Composite( image => $img_tmp3, geometry => '+'.int($w/2 + $koef).'-'.$koef );
$img->[3]->Composite( image => $img_tmp4, geometry => '+'.int($w/2 + $koef).'+'.int($h/2+$koef) );

$img->[4]->Composite( image => $img_tmp1, geometry => '-'.$koef.'-'.$koef );
$img->[4]->Composite( image => $img_tmp2, geometry => '+'.int($w/2 + $koef).'-'.$koef );
$img->[4]->Composite( image => $img_tmp3, geometry => '+'.int($w/2 + $koef).'+'.int($h/2+$koef) );
$img->[4]->Composite( image => $img_tmp4, geometry => '-'.$koef.'+'.int($h/2+$koef) );

print "here we go\n";
$img->Write('movie.gif');
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem after update

Post by magick »

Grab ImageMagick 6.5.6-9. There was a patch to the composite methods. See if that fixes your problem. If not, we'll investigate further.
dsl
Posts: 21
Joined: 2008-01-22T15:14:29-07:00

Re: Problem after update

Post by dsl »

Thanks for the prompt response!
I've just upgrated to 6.5.6-9. The problem remained :(
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problem after update

Post by fmw42 »

I don't read perl well, but after a crop don't you need a +repage to remove the virtual canvas? Is there such a command in perlmagick?

also would it not be easier to use -gravity northwest, northeast, southwest and southeast in your composites rather than -geometry?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem after update

Post by magick »

We can reproduce the problem and have a patch. Look for it in ImageMagick 6.5.6-10 Beta by sometime tomorrow.
dsl
Posts: 21
Joined: 2008-01-22T15:14:29-07:00

Re: Problem after update

Post by dsl »

Sorry guys, but still nothing. 6.5.6-9 is the latest available release.
Post Reply