title: Save original image data with modified metadata (no re-encoding) on iOS
body: <p>I want to save an image with some metadata changes in a temp folder, without re-encoding the actual image data.</p>
  
  <p>The only method that I found able to do this is <a href="http://developer.apple.com/library/ios/documentation/AssetsLibrary/Reference/ALAssetsLibrary_Class/Reference/Reference.html#//apple_ref/occ/instm/ALAssetsLibrary/writeImageDataToSavedPhotosAlbum:metadata:completionBlock:" rel="noreferrer">ALAssetsLibrary/writeImageDataToSavedPhotosAlbum:metadata:completionBlock:</a>, however, this one saves the image to the Photo Library. Instead, I want to save the image to a temp folder (for instance to share it by email, without populating the Photo Library).</p>
  
  <p>I've tried using <code>CGImageDestinationRef</code> (<a href="https://developer.apple.com/library/mac/documentation/graphicsimaging/reference/CGImageDestination/Reference/reference.html#//apple_ref/c/func/CGImageDestinationAddImageFromSource" rel="noreferrer">CGImageDestinationAddImageFromSource</a>), but it can only be created using a decoded image, which means it's re-encoding it when saved (tested, pixel bytes look different).</p>
  
  <p>Are there any other methods/classes available for iOS that can save image data along with metadata, besides using <code>CGImageDestinationRef</code>? Suggestions for workarounds would also be welcomed.</p>