0
我的應用程序允許從相機膠捲上載圖像。上載前我試圖將它們保存到我的文檔目錄時,某些圖像導致應用程序崩潰。我在保存之前將圖像轉換爲PNG,但這沒有幫助。這裏的錯誤...iPhone在某些圖像格式上窒息
Tue Aug 31 20:39:13 localhost XXX[76409] <Error>: CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component; 32 bits/pixel; 3-component color space; kCGImageAlphaLast; 1600 bytes/row.
Tue Aug 31 20:39:13 localhost XXX[76409] <Error>: CGContextConcatCTM: invalid context 0x0
Tue Aug 31 20:39:13 localhost XXX[76409] <Error>: CGContextSetInterpolationQuality: invalid context 0x0
Tue Aug 31 20:39:13 localhost XXX[76409] <Error>: CGContextDrawImage: invalid context 0x0
Tue Aug 31 20:39:13 localhost XXX[76409] <Error>: CGBitmapContextCreateImage: invalid context 0x0
,這裏是我的代碼示例...
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
UIImage *img = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
NSData *pngData = UIImagePNGRepresentation(img);
UIImage *pngImg = [UIImage imageWithData:pngData];
... code to save image ...
}
您應該在附近發生崩潰的地方提供代碼。你所得到的錯誤只是說你正在使用無效的上下文來操縱你的圖像。 – vfn 2010-09-01 02:52:28