I have a 16000x8000 image and I'm trying to load it into an NSImage. When I load it in and report the width and height to myself it tells me it's 2880x1440... What would be causing this? Here's the code I'm using to import:
then when I do
It outputs:
W 2880.000000
H 1440.000000
Why? I have verified that the image is 16000x8000 and for some odd reason when you just open the program and then save the image through it without making any transformations (flip/rotate/etc) (it's an image transforming program) it will output it as the correct 16000x8000.
I think the reason for the above note is that in the transformation functions we exchange dimensions for the images so we have:
And, of course, as I said the 'bigImage' size shows as 2880x1440..
Anyone have any ideas?
Thanks,
Alex
Code:
-(void) awakeFromNib
{
bigImage = [[NSImage alloc] initWithContentsOfFile:@"/myfile.tif"];
[bigImage setCacheMode:NSImageCacheNever];
[bigImage setDataRetained:YES];
[imgView setImage:bigImage];
NSRunAlertPanel(@"DONE",@"DONE",@"OK",nil,nil);
}
then when I do
Code:
NSLog(@"W %f",bigImage.size.width); NSLog(@"H %f",bigImage.size.height);
It outputs:
W 2880.000000
H 1440.000000
Why? I have verified that the image is 16000x8000 and for some odd reason when you just open the program and then save the image through it without making any transformations (flip/rotate/etc) (it's an image transforming program) it will output it as the correct 16000x8000.
I think the reason for the above note is that in the transformation functions we exchange dimensions for the images so we have:
Code:
NSImage *tmpImage;
NSSize dimensions = [bigImage size];
tmpImage= [[NSImage alloc] initWithSize:dimensions];
And, of course, as I said the 'bigImage' size shows as 2880x1440..
Anyone have any ideas?
Thanks,
Alex