• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Question about "JPEG writer requires compacted components"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Drawing a *blue* ProgressIndicator on the Dock app icon in the background / offscreen drawing
  • Next by Date: malloc in obj-c/cocoa
  • Previous by thread: Re: Class variable?
  • Next by thread: malloc in obj-c/cocoa
  • Index(es):
    • Date
    • Thread