So, we have a NSimage that's cropped and resized according to user input. It's working fine on both retina and non-retina Macs.
Problem is, when I connect a non-retina screen to my retina macbook, it started to double the size of the images.
The problem only occurs when launching the app on the second, non-retina screen.
While debugging, I noticed the image doubles at this point:
CGImageSourceRef finalSource = CGImageSourceCreateWithData((__bridge CFDataRef)([newImage TIFFRepresentation]), NULL);
CGImageRef finalRef = CGImageSourceCreateImageAtIndex(finalSource, 0, NULL);
In my tests, newImage.size is 800x600, but (int)CGImageGetWidth(finalRef) is returning 1600.
I also tried:
CGImageRef cgImage = [newImage CGImageForProposedRect:&imageRect context:[NSGraphicsContext currentContext] hints:nil];
But still having the same result.
Any ideas?