Cocoa not converting NSImage

DartStu

Registered
I am writing a small program in Objective-C to retrieve individual frames from a quicktime movie. I have debugged and debugged and debugged and have one problem I can't seem to get around.

I currently have an NSImage that is returned from currentFrameImage and then tried to convert to .TIFF using TIFFRepresentation.

NSImage * fram = [film currentFrameImage];
NSData * fram1 = [fram TIFFRepresentation];
[fram1 writeToFile:name atomically:YES];

When this failed to work I looked around of many forums, google, etc. And changed my code to:

NSImage * fram = [film currentFrameImage];
//NSData * fram1 = [fram TIFFRepresentation];
NSArray * testArray = [fram representations];
NSImageRep * testType = [testArray lastObject];
NSData * fram1 = [NSBitmapImageRep representationUsingType:NSBMPFileType properties:nil];
[fram1 writeToFile:name atomically:YES];


But this still fails to work.
Any thoughts would be greatly appreciated.

Thanks!

-DartStu
 
Back
Top