title: Get the correct image width and height of an NSImage
body: <p>I use the code below to get the width and height of a NSImage:</p>
  
  <pre><code>NSImage *image = [[[NSImage alloc] initWithContentsOfFile:[NSString stringWithFormat:s]] autorelease];
  imageWidth=[image size].width;
  imageHeight=[image size].height;
  NSLog(@"%f:%f",imageWidth,imageHeight);
  </code></pre>
  
  <p>But sometime <code>imageWidth</code>, <code>imageHeight</code> does not return the correct value. For example when I read an image, the EXIF info displays:</p>
  
  <pre><code>PixelXDimension = 2272;
  PixelYDimension = 1704;
  </code></pre>
  
  <p>But imageWidth, imageHeight outputs</p>
  
  <pre><code>521:390 
  </code></pre>