Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-06

PascalMagick MagickCommandGenesis

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marcos Douglas
to Esmond Bridgeman
Esmond Bridgeman wrote
How difficult would it be to add the MagickWand mogrify command-line function in mogrify.h to PascalMagick? It looks like a good way to provide a sort of simple scripting using the ImageMagick command line interface.

I use IM binaries directly, without problems.

Marcos Douglas

Reply by email

Felipe Monteiro de Carvalho
to Esmond Bridgeman: How difficult would it be to add the MagickWand mogrify command-line function in…
Esmond Bridgeman wrote
How difficult would it be to add the MagickWand mogrify command-line function in mogrify.h to PascalMagick?

Just as easy as translating any C headers to Pascal.

It looks like a good way to provide a sort of simple scripting using the ImageMagick command line interface.

PascalMagick is not directly related to any command line. It is a direct binding to the ImageMagick libraries.

Felipe Monteiro de Carvalho

Reply by email

Esmond Bridgeman
to Felipe Monteiro de Carvalho

I was wanting to use the binaries directly instead of the imageMagick "convert.exe" command-line program to run something like this:

convert -define jpeg:size=500x500 -thumbnail "75x75>" -unsharp 0x.5 -strip -quality 80 "in.jpg" "out.jpg"

I guess I could do this with magick wand functions but the magick command line programs do clever things like only partially decoding jpegs if only a small thumbnail is needed and intelligently choosing resampling algorithms depending on how much an image is resized.

There's a new 'MagickImageCommand' function (mentioned here: http://www.imagemagick.org/discourse-server/viewtopic.php?f=6&t=20527#p82046) which seems to be what I need.

Where can I find a good tutorial or tips on translating C headers? (probably an unhill struggle as I've minimal C experience)

Thanks

On Mon, Jun 18, 2012 at 7:05 AM, Felipe Monteiro de Carvalho <

Show quoted text 24 lines
wrote: On Sun, Jun 17, 2012 at 2:17 PM, Esmond Bridgeman wrote: > How difficult would it be to add the MagickWand mogrify command-line > function in mogrify.h to PascalMagick? Just as easy as translating any C headers to Pascal. > It looks like a good way to provide a > sort of simple scripting using the ImageMagick command line interface. PascalMagick is not directly related to any command line. It is a direct binding to the ImageMagick libraries. -- Felipe Monteiro de Carvalho -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120618/1721e901/attachment-0001.html>

Reply by email

Felipe Monteiro de Carvalho
to Esmond Bridgeman
Esmond Bridgeman wrote
Where can I find a good tutorial or tips on translating C headers? (probably an unhill struggle as I've minimal C experience)

This page has some info:

http://wiki.freepascal.org/Creating_bindings_for_C_libraries#Manual_conversion_of_C_headers_to_Pascal

I like the manual method, some other people like the h2pas. I think that h2pas distorces the sources so it makes it harder to maintain things later on if the bindings change.

Use also the existing PascalMagick bindings as an example of how to do it.

Felipe Monteiro de Carvalho

Reply by email

Bernd
to Felipe Monteiro de Carvalho

2012/6/18 Felipe Monteiro de Carvalho :

Show quoted text 10 lines
On Mon, Jun 18, 2012 at 9:44 AM, Esmond Bridgeman wrote: > Where can I find a good tutorial or tips on translating C headers? (probably > an unhill struggle as I've minimal C experience) This page has some info: http://wiki.freepascal.org/Creating_bindings_for_C_libraries#Manual_conversion_of_C_headers_to_Pascal I like the manual method

the chelper package for Lazarus is quite helpful for semi-automatically translating one expression at a time. Copy&paste the C definition into the source editor, place the cursor at the begining of it and press Ctrl+B. Often the resulting translations don't even need manual adjustments anymore (and chelper can learn the type names you want to use). It saves a lot of time. I'm translating only relatively simple things with it, enums, relatively simple structs and function declarations and no obscure macros and other deep black magic C stuff, so for me the chelper is a great help.

Reply by email