i'm trying to load images using magick core. i came up with the following code for a image-loading routine:
Code: Select all
namespace MC
{
#include <magick/MagickCore.h>
}
void * vtuLoadImage_IM(const char *imagePath, uint32_t *pic_size)
{
static int times = 0;
if (times == 0)
MagickCoreGenesis("/Users/julian/Documents/Development/_BUILD/Debug/VTDemo.app/Contents/MacOS/VTDemo", MC::MagickFalse);
MC::ExceptionInfo *exception = MC::AcquireExceptionInfo();
MC::ImageInfo *image_info = CloneImageInfo((MC::ImageInfo *) NULL);
strcpy(image_info->filename, imagePath);
MC::Image *image = ReadImage(image_info, exception);
char *image_data = (char *)malloc(c.pageMemsize);
assert(image);
const MC::PixelPacket *p = GetVirtualPixels(image, 0, 0, image->columns, image->rows, exception);
memcpy(image_data, p, c.pageMemsize);
DestroyImage(image);
return image_data;
}
here is the full backtrace:
Code: Select all
#0 0x000000010025ed1c in gomp_resolve_num_threads ()
#1 0x00000001002305ee in ResourceComponentGenesis ()
#2 0x00000001001ecfe5 in MagickCoreGenesis ()
#3 0x0000000100016e8e in vtuLoadImage_IM (imagePath=0x11825dda0 "/Users/julian/Documents/Development/VirtualTexturing/_texdata/32k_b1_jpg/tiles_b1_level1/tile_1_36_35.jpg", pic_size=0x100059bc0) at /Users/julian/Documents/Development/VirtualTexturing/LibVT/LibVT_Utilities.cpp:141
#4 0x000000010002e7fd in vtLoadNeededPages () at /Users/julian/Documents/Development/VirtualTexturing/LibVT/LibVT_PageLoadingThread.cpp:70
thanks a lot!
