Jump to content
Larry Ullman's Book Forums

C++ And Image Magick


Recommended Posts

Hi,  I thought that I'd post another of my 'lessons learned' - this time interfacing between a C++ dll (though I suppose it doesn't need to be a dll) and Image Magick. 

 

After much Googling it seems that there are 3 ways for a C++ program to invoke Image Magick functionality:

 

1) via the 'core' C API

2) via Magick++

3) via Wand

 

In my case I only wanted basic Image Magick functions.  I eventually found a nice simple example which showed the difference between approach 1) and approach 3).  Approach 3 - i.e., via Wand was far simpler.

 

I could not get approach 2 to work for me at all but I'm sure that someone knowledgeable could.

 

So I proceeded to experiment with the Wand interface.

 

I am using Visual C++ 2008 Express Edition as my IDE.  There is some very good advice re the settings that you need to make in the IDE so that the compiler and linker can find the files they need - see http://www.imagemagick.org/discourse-server/viewtopic.php?t=11757 and in particular el_supremo's post dated 2008-07-26T08:05:28-07:00.

 

My C++/Wand code just reads in a jpg image file, sets size and quality parameters and then writes the resized file out with its new size and quality and a new file name, all using Wand methods.

 

It took me about 3 weeks and hundreds of Google searches to get to this outcome, or maybe I'm just a slow learner :-)

 

Cheers from Oz.

Link to comment
Share on other sites

 Share

×
×
  • Create New...