0

我有一个简单的小 osx 应用程序,它只启动一个 IKPictureTaker,然后将生成的图片保存为 .tiff 文件。一切似乎都很好,但是每次我拍照时都会反复出现此错误:

2009-11-10 12:25:38.890 Take A Picture[855:9c23] *** QTCaptureSession warning: Session received the following error while decompressing video: Error Domain=NSOSStatusErrorDomain Code=-67441 "Operation could not be completed. (OSStatus error -67441.)". Make sure that the formats of all video outputs are properly configured.

代码非常简单:

- (void)awakeFromNib
{


IKPictureTaker *sharedPictureTaker = [IKPictureTaker pictureTaker];

[sharedPictureTaker setValue:[NSNumber numberWithBool:YES] forKey:IKPictureTakerShowEffectsKey];

[sharedPictureTaker beginPictureTakerWithDelegate:self didEndSelector:@selector(pictureTakerDidEnd:returnCode:contextInfo:) contextInfo:nil];
}


- (void) pictureTakerDidEnd:(IKPictureTaker *) picker
             returnCode:(NSInteger) code
            contextInfo:(void*) contextInfo
{

NSImage *image = [picker outputImage];
NSString *folder = @"/Users/Mike/Library/Application Support/file.tiff";
folder = [folder stringByExpandingTildeInPath];
[[image TIFFRepresentation] writeToFile:@"~/Library/Application Support/file2.tiff" atomically:NO];
}
4

1 回答 1

1

听起来您的机器可能存在一些配置问题。你能在另一个上测试它吗?你的应用程序中还有其他事情发生吗?如果您选择不同类型的图像文件或仅在捕获时获得相同的结果?

您的字符串在编写方法中有些混乱,但除此之外,代码在其他处女应用程序中对我来说效果很好。

于 2009-11-10T22:26:22.020 回答