[Pyobjc-dev] Segmentation fault with CGImageCreateWithImageInRect
Brought to you by:
ronaldoussoren
From: Orestis M. <or...@or...> - 2009-11-26 23:31:43
|
Hi, Mac OS X 10.6.2, stock python 2.6, pyobjc2.2 in a virtualenv. This snippet of code crashes with a segfault when run from the command line: from Foundation import CFURLCreateWithFileSystemPath, kCFURLPOSIXPathStyle from Quartz import CGImageSourceCreateWithURL, CGImageSourceCreateImageAtIndex, CGImageCreateWithImageInRect, CGRectMake path = 'Songs/lyricsthumb.png' imageURL = CFURLCreateWithFileSystemPath(None, path, kCFURLPOSIXPathStyle, False) imageSource = CGImageSourceCreateWithURL(imageURL, None) cgImage = CGImageSourceCreateImageAtIndex(imageSource, 0, None) rect = CGRectMake(0, 0, 100, 100) cropped = CGImageCreateWithImageInRect(cgImage, rect) #segfault here It works fine when run from inside an actual application. It used to work fine in stock Leopard PyObjC. Some background: We are trying to get our applications compatible with PyObjC 2.2 and Python 2.6, in preparation of our upgrade to SL on the target machines. While the applications themselves mostly run fine, the tests are having weird troubles like this, which makes the transition a non-starter. Is there anything we can do to help you help us? Regards, Orestis |