title: Save UIImage with 72 dpi (Retina Simulator saves with 144 dpi)
body: <p>I have a really strange problem...
  In my iPhone app, the user can open an image from the camera roll, in my example an
   wallpaper with 1920 x 1080 px (72 dpi).</p>
  
  <p>Now, a want to resize the image to a width of e.g. 1024 px:</p>
  
  <pre><code>+ (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize {
      UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0);
      [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
      UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
      NSLog(@"New image has w=%f, h=%f", newImage.size.width, newImage.size.height);
      return newImage;
  }
  </code></pre>
  
  <p>With the log message I can check, that the width is 1024 and the height is 576. Everything is all right!</p>
  
  <p>But now, I save the image in the Documents folder:</p>
  
  <pre><code>NSString *jpgPath = [NSHomeDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"Documents/%@.jpg", uniqueId]];
  [UIImageJPEGRepresentation(originalImage, 1.0) writeToFile:jpgPath atomically:YES];
  </code></pre>
  
  <p>And now a very strange effect:<br>
  a) When I use the Retina Simulator, the saved image at "/Users/[...]/Library/Application Support/iPhone Simulator/5.1/Applications/[...]/Documents/" has a size of 1,5 MB and the resolution is 2048 x 1152 px at 144(!) dpi.</p>
  
  <p>b) When I use the normal Simulator, the size is 441 KB and the resolution is 1024 x 768 px at 72 dpi.</p>
  
  <p>How can a force to save an UIImage with 72 dpi?</p>