PDA

View Full Version : Mac OS X 10.7. Canon EDSDK Crashes with EXC_BREAKPOINT (SIGTRAP) in CFRelease



weisseruebe
14th March 2012, 02:22
Hi,

I'm trying to use the Canon EDSDK with QT. That works quite smooth for all issues regarding the Camera Remote functions.
But when it comes to Raw development, I can't get rid of a crash EXC_BREAKPOINT (SIGTRAP) in CFRelease + 25.
The Canon SDK for Mac OS X seems to be written in Objective C.

The same code I'm using in QT 4.8.0 / x86 is working fine when compiling as 32bit in XCode 4, adapted to Objective C.

I tried creating a Cocoa Autoreleasepool manually, tried a lot of more things to track down the problem - without any success.
As soon as it reaches "EdsSaveImage" it crashes. :mad:
It gets a s far as printing out the width and height. Error codes are always 0 = EDS_ERR_OK

Any experience with Canon EDSDK or similar issues?



EdsError err=EDS_ERR_OK;
EdsImageRef mimageRef;

// Create FileStream
EdsStreamRef inStream = 0;
err = EdsCreateFileStream(
path.toAscii(),
kEdsFileCreateDisposition_OpenExisting,
kEdsAccess_ReadWrite,
&inStream
);
// Create ImageRef
if(!err){
err = EdsCreateImageRef( inStream, &mimageRef );
}
qDebug("LOAD %d",err);

EdsUInt32 jpegQuality = 9;
EdsTargetImageType imageType = kEdsTargetImageType_Jpeg;

err = EDS_ERR_OK;

// Create Target Stream
EdsStreamRef targetStream;
QString sPath = "testttr.jpg";
err = EdsCreateFileStream((const char*) sPath.toAscii(), kEdsFileCreateDisposition_CreateAlways, kEdsAccess_ReadWrite, &targetStream);
qDebug("CREATE %d",err);

// Set SaveImageSetting
EdsSaveImageSetting saveImageSetting = {0};
saveImageSetting.JPEGQuality = jpegQuality;

err = EdsGetImageInfo(mimageRef, m_imageSource, &imageInfo );
qDebug("HEIGHT %d",imageInfo.height);
qDebug("WIDTH %d",imageInfo.width);

// Save Image
if(!err) err = EdsSaveImage( mimageRef, imageType, saveImageSetting, targetStream);
// Release
if(targetStream) EdsRelease(targetStream);

return err;