Re: Saving jpeg data
Re: Saving jpeg data
- Subject: Re: Saving jpeg data
- From: Nick Zitzmann <email@hidden>
- Date: Tue, 30 Mar 2010 14:50:27 -0600
On Mar 30, 2010, at 2:37 PM, John Nairn wrote:
> My application now saves jpeg thumbnail data from an NSImage of a bit map by using
>
> [NSBitmapImageRep representationUsingType:properties]
>
> selector and it works fine in Snow Leopard development. When I run the app in Tiger, however, the code fails with following selector problem in the Console:
>
> 2010-03-30 13:03:24.689 GEDitCOM II[631] start saving file at 2010-03-30 13:03:24 -0700
> 2010-03-30 13:03:26.738 GEDitCOM II[631] *** -[NSCachedImageRep representationUsingType:properties:]: selector not recognized [self = 0x930a8c0]
>
> I checked and [NSBitmapImageRep representationUsingType:properties] has been available since 10.0. I don't know what NSCachedImageRep is and I did not think I created or accessed one either?
Are you, by any chance, creating this image by locking focus on an NSImage and then drawing? NSCachedImageRep is more or less obsolete in Snow Leopard, but before SL, if you did this, you ended up with an NSCachedImageRep instead of an NSBitmapImageRep.
In any case, one way of working around this problem is by putting the NSCachedImageRep into an NSImage if it isn't in one already, calling -TIFFRepresentation on the image, and using the resulting data to create a new NSBitmapImageRep.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden