NSImage and PNG's

I have a simple Cocoa app that loads and displays a texture. The view that it is displayed in is 1024 by 512 because that is most likely the dimensions of the images that I'll be working with. I have a PNG file that opens up in Preview as 1024x512, in other apps as such, and the Finder indicates that that's the size of it as well. For some reason,

imageSize is 458 by 229 every time. I tried resaving it, no change but when I saved it as a TGA file, it loads and displays correctly.

All of the images I'll be receiving will be in PNG format because they'll be loaded into the iPhone. I could convert them all but it would be nice if I didn't have to. Does anyone know why PNG files are loading like that? Thanks in advance.

NSImage does some annoying automatic DPI conversion, which can screw with reported sizes. Also, you won't necessarily be able to get bitmap data out of it in a known pixel format. You'd be better off using ImageIO or libpng. ImageIO premultiplies data, so if that's a problem, go with libpng.