valid arguments for the magick() function?

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
sanderton

valid arguments for the magick() function?

Post by sanderton »

Hello!

I've been looking for a list of valid arguments for the magick() function (C++ API). The Image documentation gives "GIF" as an example, and some of the example code has "RGBA". I've also stepped into the code but I just can't seem to find a list or range; I must be missing something!

Could someone point me in the right direction?

Thanks,
sanderton
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Give magick() any image format listed here http://magick.imagemagick.org/script/formats.php.
sanderton

format "BMP" not recognized

Post by sanderton »

Thanks, that's exactly what I've been looking for!

I just have a little problem with some code I've written; I'm getting an exception, "ImageMagick: Unrecognized image format (BMP)".

Code: Select all

Magick::Geometry dims( nCols, nRows );
Magick::Image IMAlpha;
IMAlpha.size( dims );
for ( int j = 0; j < nRows; j++ )
{
    // ...writing pixel by pixel, the alpha bits from another image
}
IMAlpha.magick( "BMP" );
I also tried calling magick() before the for-loop but had the same result. I'm really puzzled because I've used the same code elsewhere and had no problem; the only difference is that I was using other image formats like "TIFF", "JPEG", "PNG", etc.

Any insight would be really appreciated.

Thanks again,
sanderton
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

We would need a small working program that reproduces the problem before we could help other than say the exception you are getting is thrown if ping() is called with a NULL in-memory image.
sanderton

example using magick()

Post by sanderton »

I based my code:

Code: Select all

Magick::Geometry dims( nCols, nRows );
Magick::Image IMAlpha;
IMAlpha.size( dims );
IMAlpha.magick( "BMP" );
on the following sample from the Image documentation, Blob section:

Code: Select all

    Blob blob( data, length );
    Image image;
    image.size( "640x480")
    image.magick( "RGBA" );
    image.read( blob);
I can't see any real difference.
sanderton

BMP decode delegate missing

Post by sanderton »

OK, I finally found out what's happening. When I debugged down into the IM code I found an exception in IsMagickConflict():
UnableToOpenModuleFile `C:\...\IM_MOD_DB_BMP_.dll': No such file or directory

So, a missing DLL! This exception info doesn't seem to be propagated up the calling stack and another message is output, which is why I was confused!

Cheers!
sanderton
Post Reply