Re: [Pyobjc-dev] Segmentation fault with CGImageCreateWithImageInRect
Brought to you by:
ronaldoussoren
From: Orestis M. <or...@or...> - 2009-12-01 09:05:26
|
On 1 Dec 2009, at 10:53, Ronald Oussoren wrote: > > On 27 Nov, 2009, at 0:31, Orestis Markou wrote: > >> 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? > > I'll spent some time in the debugger. This should work, but obviously doesn't. Thanks. Is there anything I can do to help? Orestis > Ronald |