views:

28

answers:

1

Hi i have a lot of image reading in my app and when I load the files i use CGImageGetWidth and CGImageGetHeight to get the sizes of the images.

However this does not seem to return the right values all the time.

For example if I have an image whose size is 114x14, these functions will return 126x22 or something random like that.

The really odd part is that it doesn't happen all the time(changes from build to build) but it tends to happen to the same group of images.

So either i have some kind of coding error that i am not aware of or the images have some setting to them that makes them handle differently.

Anybody know of what could possibly cause this kind of behavior?

Thanks

+1  A: 

Check the resolution of the image. Some image formats allow for a pixels-per-inch of something other than the standard 72 pixels per inch.

lucius
Thank you!That was the problem.
funckymonk
or so it seemed, but I guess not.Any other ideas?
funckymonk