title: Take photo and store in custom album in Xamarin.iOS
body: <p>I want to take a photo and save them within a custom album on a iPad.
  I tried a lot of things but ended always with wrong image orientation.</p>
  
  <p>My current procedure is:</p>
  
  <ol>
  <li>Take photo with Xamarin.Media and safe image somewhere in my app path</li>
  <li>Create custom album if it's not existing</li>
  <li>Load image from temporary path and save to the album</li>
  <li>Add the image (asset) additionally to the custom album created in 2.</li>
  </ol>
  
  <p>The workflow above is fully working except of saving the correct orientation. After loading an image with <code>library.AssetForUrl()</code> the containing orientation is every time up. Also after converting from <code>asset</code> -> <code>CGImage</code> -> <code>UImage (uiImage.Orientation)</code>.</p>
  
  <p>In step 3 I tried to set the orientation the the appropriate one with </p>
  
  <pre><code>var image = new UIImage(tempImage.CGImage, 1.0f, UIImageOrientation.MyOrientation)
  </code></pre>
  
  <p>and also with the save command </p>
  
  <pre><code>library.WriteImageToSavedPhotosAlbum(image.CGImage, myOrientation, SaveCompletionBlock)
  </code></pre>
  
  <p>But the orientation is still ignored. I checked this by opening the Album application as well as loading the file in my self written gallery app.</p>
  
  <p>I want to avoid the use of the <code>iOS</code> picker to take photos. This will produce a mess of code!</p>
  
  <p>Or is there any third party library which allows to take photos and store them in a custom album? Which takes care of all the metadata information? It doesn't matter if it's written in <code>objective-c</code> or <code>c#</code>. I will create bindings for it. But it's awful to work with the camera and albums in <code>iOS</code>.</p>