Cannot Make Any Image Objects In C++

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Locked
Manannan
Posts: 3
Joined: 2020-03-02T18:51:44-07:00
Authentication code: 1152

Cannot Make Any Image Objects In C++

Post by Manannan »

I am attempting to make a Magick image object with the following line:

magicKImage = new Magick::Image(Magick::Geometry(DISPLAY_DEFAULT_WIDTH, DISPLAY_DEFAULT_HEIGHT), Magick::ColorRGB(0,0,0));

Every time I do I get FileOpenError(430).

A few things to note:
I call Magick::InitializeMagick("") in the constructor of the object which is calling the problematic line

I need to keep the image of the heap, as I have to retain it's state throughout the lifetime of the program.

I stepped my debugger into the actual Magick code to find out what was going on. The 'magick_info' object on line 1499 of constitute.cs is NULL. This seems to be happening due to a NULL 'magick_list' in 'GetMagickInfoEntryLocked' (magick.c).

ImageMagick is not running on the main thread of the app, but the initialize is running on the same thread as the problematic line.

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Cannot Make Any Image Objects In C++

Post by snibgo »

What are the values of DISPLAY_DEFAULT_WIDTH and DISPLAY_DEFAULT_HEIGHT?
snibgo's IM pages: im.snibgo.com

Manannan
Posts: 3
Joined: 2020-03-02T18:51:44-07:00
Authentication code: 1152

Re: Cannot Make Any Image Objects In C++

Post by Manannan »

#define DISPLAY_DEFAULT_WIDTH 320
#define DISPLAY_DEFAULT_HEIGHT 200

Manannan
Posts: 3
Joined: 2020-03-02T18:51:44-07:00
Authentication code: 1152

Re: Cannot Make Any Image Objects In C++

Post by Manannan »

I solved my own problem.
I got very confused at the beginning as to whether I needed a static or a dynamic build, so I built both to try both.
I think that that somehow caused a horrible hybrid, so I fixed it by destroying all of my build artifacts and trying again.

Locked