MSL/Conjure - Incorrect (No) handling of geometry/x, y values
Max <[email protected]> Fri, 12 Sep 2008 14:40:47 +0200
| Newsgroups | gmane.comp.video.graphicsmagick.bugs |
|---|---|
| Message-ID | <20080912124047.GA11449@studiernix> |
Hi all,
I used ImageMagicks and GraphicsMagicks conjure to interpret a
MSL-script that, among others, composes a group of images with a
background image.
Instead of using the geometry or x,y values in my script GraphicsMagick centered
all images of the group over each other on the background image.
ImageMagick did the positioning right but wasn't able to distinguish
between the first and the rest of the images.
I wrote a small patch for msl.c that fixes GraphicsMagicks behaviour which I think
is a bug.
I hope you can review the patch and include it in your next release.
Here is an example MSL-script which demonstrates what I mean.
<?xml version="1.0" encoding="ISO-8859-1"?>
<group>
<image id="cloud3.gif">
<read filename="cloud3.gif"/>
<resize geometry="250x90"/>
</image>
<image id="cloud4.gif">
<read filename="cloud4.gif"/>
<resize geometry="190x100"/>
</image>
<image>
<read filename="background.jpg"/>
<composite image="cloud3.gif" geometry="+740+470"/>
<composite image="cloud4.gif" geometry="+390+415"/>
</image>
<write filename="result.png"/>
</group>
Best regards from Munich, Germany
Max
PS: I'm new to the list, I hope it's the right place for this topic.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Graphicsmagick-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-bugs
patch.diff
(text/x-diff, 1.1 KB)
Index: msl.c
===================================================================
RCS file: /GraphicsMagick/GraphicsMagick/coders/msl.c,v
retrieving revision 1.87
diff -u -r1.87 msl.c
--- msl.c 24 Jun 2008 20:09:20 -0000 1.87
+++ msl.c 12 Sep 2008 10:12:07 -0000
@@ -927,6 +927,7 @@
if (LocaleCompare(keyword,"geometry") == 0)
{
(void) GetMagickGeometry(value,&x,&y,&width,&height);
+ gravity=ForgetGravity;
break;
}
else if (LocaleCompare(keyword,"gravity") == 0)
@@ -980,6 +981,7 @@
if (LocaleCompare(keyword,"x") == 0)
{
x = atoi( value );
+ gravity=ForgetGravity;
break;
}
ThrowException(msl_info->exception,OptionError,UnrecognizedAttribute,keyword);
@@ -991,6 +993,7 @@
if (LocaleCompare(keyword,"y") == 0)
{
y = atoi( value );
+ gravity=ForgetGravity;
break;
}
ThrowException(msl_info->exception,OptionError,UnrecognizedAttribute,keyword);