Possible bug in 6.0.7? Need help finding the problem.
Posted: 2007-01-29T18:46:08-07:00
I've been staring at this bug for 2 hours now. I am beginning to think maybe its a bug in the ImageMagick code somewhere. I am getting an assertion failure in 'image.c' in the CloneImage function on line 896. I am running Centos4, ImageMagick++ version 6.0.7.1-16 (the most recent release available in my repository.) What's really bugging me is that this code works just fine on my Gentoo box that runs ImageMagick 6.3.
Here is a snippet of the code that's causing the problem. 'tiles' is a list of class 'tile' that contains x and y coords as well as an image. Each tile is supposed to be drawn into 'out' at the coords it specifies:
I have been able to identify the assertion error as this line of code in image.c, in the function CloneImage:
Thanks for any help you might be able to offer!
Here is a snippet of the code that's causing the problem. 'tiles' is a list of class 'tile' that contains x and y coords as well as an image. Each tile is supposed to be drawn into 'out' at the coords it specifies:
Code: Select all
int prev_id = 0;
tile *tl = NULL;
list<Drawable> ts;
for (tiles_it = tiles.begin(); tiles_it != tiles.end(); tiles_it++) {
//if we've come upon a new tile
//draw out any waiting images and load up the new tile
if ((*tiles_it).id() != prev_id) {
if (ts.empty() == false) {
/**************
out.draw(ts) is the line that fails!
**************/
out.draw(ts);
ts.clear();
}
prev_id = (*tiles_it).id();
//unload the image now that we're done with it
if (tl != NULL)
tl->remove_image(base_size);
tl = &(*tiles_it);
}
//add the current tile to the list of images to be drawn
try {
//I have verified that tl->get_image() is indeed working
//it returns a reference to an Image that is supposed to
//be drawn
ts.push_back(DrawableCompositeImage((*tiles_it).x() * base_size, (*tiles_it).y() * base_size, tl->get_image(base_size)));
} catch (exception &e) {
throw;
}
}
Code: Select all
assert(image != (const Image *) NULL);