Page 1 of 1

SIGBART when calling image.geometry

Posted: 2011-11-18T02:06:51-07:00
by jupiter
Hi

when ever i try to access the geometry with following code:

#include <Magick++.h>
#include <Magick++/Geometry.h>

Code: Select all

 
void function() {
Image image( "100x100", "white" );
    image.read("test.jpg");
    Magick::Geometry geo = image.geometry();
    MagickCore::ExceptionInfo exceptionInfo;
    MagickCore::GetExceptionInfo( &exceptionInfo );
    MagickCore::ShadowImage(image.image(), 5, 5, 200, 200 , &exceptionInfo);
    image.write( "test123.jpg" );
}
i recieve a SIGBART crash when calling image.geometry()

what am i doing wrong?

Re: SIGBART when calling image.geometry

Posted: 2011-11-18T05:35:09-07:00
by magick
What is your OS, compiler, compiler version? It looks like your program is not handling exceptions properly. It should report:
  • terminate called after throwing an instance of 'Magick::WarningOption'
    what(): Magick: Image does not contain a geometry
    Abort
Fix by specifying a geometry before you call image.geometry(). For examples, grab the ImageMagick source distribution and look in the ImageMagick-6.7.3-6/Magick++/demo or test folders.

Re: SIGBART when calling image.geometry

Posted: 2011-11-18T06:17:35-07:00
by jupiter
I'm on mac osx lion with gcc 4.2.1