Question about "JPEG writer requires compacted components"
Question about "JPEG writer requires compacted components"
- Subject: Question about "JPEG writer requires compacted components"
- From: Jay Koutavas <email@hidden>
- Date: Fri, 6 Feb 2004 16:11:55 -0500
On Jaguar (10.2.8), my application has been happily loading a
"foo.bmp" file into a NSImage and then converting it into a JPEG
using the following code:
NSImage* image = [[NSImage alloc] initWithContentsOfFile:@"foo.bmp"];
NSArray* reps = [image representations];
NSData* bitmapData =
[NSBitmapImageRep representationOfImageRepsInArray:reps
usingType:NSJPEGFileType
properties:[NSDictionary dictionaryWithObject:
[NSDecimalNumber numberWithFloat:0.9]
forKey:NSImageCompressionFactor]];
On Panther (10.3.2), attempting to open the same exact file using
this code, results in -[NSBitmapImageRep
presentationOfImageRepsInArray] failing with this exception:
JPEG writer requires compacted components
(bits/component * components/pixel = bits/pixel)
What exactly has changed between Jaguar and Panther that brought
about this exception? And what do I have to do to avoid getting it on
Panther?
(The "foo.bmp" file doesn't have an alpha channel. It was created
from a Windows screenshot. This exception isn't unique to just this
.bmp file, I'm using "foo.bmp" as an example, it's failing all over
the place on .BMPs when ran on Panther.)
Thanks for your reply!
/jay
--
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Jay Koutavas
mailto:email@hidden
Heynow Software
http://www.heynow.com
Windham, New Hampshire, USA
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.