Re: saving images on panther
Re: saving images on panther
- Subject: Re: saving images on panther
- From: "Sean McBride" <email@hidden>
- Date: Thu, 12 May 2005 10:58:26 -0400
- Organization: Rogue Research
On 2005-05-12 12:17, Cornelius Jaeger said:
>+ (NSDictionary *) fileRepresentationDictionary
>{
> return [NSDictionary dictionaryWithObjectsAndKeys:
> NSTIFFFileType, @"tif",
> NSTIFFFileType, @"tiff",
> NSBMPFileType, @"bmp",
> NSJPEGFileType, @"jpg",
> NSJPEGFileType, @"jpeg",
> NSGIFFileType, @"gif",
> NSJPEGFileType, @"png",
> nil];
NSTIFFFileType is an enum, not an objective C object, you can't store it
in a dictionary. NSDictionary's can only contain plist types.
>+ (NSBitmapImageFileType)fileTypeForPath:(NSString *)path
>{
> NSString * ending = [[[path lastPathComponent] pathExtension]
>lowercaseString];
> return (NSBitmapImageFileType)[[NSImage
>fileRepresentationDictionary] valueForKey:ending];
The need for this cast is a clue of your error.
Also, your fileTypeForPath: method will fail entirely for files without
filename extensions.
Also, don't forget NSPNGFileType and NSJPEG2000FileType.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden