Re: image offset

Bob Friesenhahn <[email protected]> Fri, 12 Jul 2019 07:43:40 -0500 (CDT)
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
On Fri, 12 Jul 2019, mick crane wrote:
>
> I think you might have misinterpreted what I meant by "stab in the dark 
> syntax".
> I am meaning *my* understanding of the Perl syntax.

I used to be ok with Perl syntax, but now I need to look at examples 
and struggle a bit. :-)

> Am I correct in thinking that there are not 2 libraries, methods, whatever 
> they are called, but just the one
> in the gm code.
> so
> "system (gm convert rose: -page "+22+48" crap.png);"
>
> calls the same piece of code as
> "$image->Convert(-page +22 +48);"
> or something like that ?
> and Graphics::Magick translates the syntax to call the gm code in a way it 
> understands ?

The 'gm' utility and PerlMagick are based on a common shared library 
written in the C language.  PerlMagick is a thin wrapper around the 
library.  Using PerlMagick for multiple operations is much more 
efficient than using the utility for multiple operations since 
re-initialization is avoided and algorithms achieving the desired 
objective may be easier using PerlMagick since they may be implemented 
at a lower-level.

> I've mentioned I'm still struggling to understand how to use Perl but from 
> what I have managed to comprehend find it really useful.
> It is the proper method to send options in Perl to gm I could really do with 
> help understanding.

Keep in mind that GraphicsMagick is open-source free software and so 
you can look at all of its source code, including the PerlMagick demo 
and test programs under the PerlMagick directory in the source 
package.  There are many examples to be found there.  Many years ago I 
wrote a PerlMagick based package called WebMagick 
(https://sourceforge.net/projects/webmagick/) and this source code 
might provide you with ideas.

When I wrote WebMagick in 1997, ImageMagick and PerlMagick had lots of 
memory leaks so avoiding the leaks influenced the implementation of 
WebMagick.  The GraphicsMagick version of PerlMagick 
(Graphics::Magick) should have virtually no memory leaks.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt