I noticed today that a piece of code I wrote for Jaguar/Panther no
longer works right in Tiger. I didn't change anything, and the exact
same code still works flawlessly on Panther.
to create the NSBitmapImageRep, and then I fetch the bitmap base
address and fill it with data. On Tiger, the resulting image looks
like garbage when displayed or serialized to TIFF. It looks like
there's something wrong with the data length calculations, depending
on the target width the rows are skewed. It seems to work correctly
when the image width in pixels is a multiple of 24 which is the
number of bits per sample times the number of channels.
The test case below produces correct results on Panther, and the
exact same binary run on Tiger will show the problem. For comparison,
the ".raw" file can be opened in Photoshop.
Is this a bug in Tiger or have I been doing something wrong all along
without getting into trouble?
I see there's a new, similar method in Tiger but I'd rather not use
that one because my code needs to run on Jaguar and Panther too.
#import <Cocoa/Cocoa.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int width = 100, height = 100;
int datalength = width * height * 3;
_________________________________________________________________
Marc Liyanage http://www.entropy.ch
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden