title: Phonegap iOS Front Camera - Flipped Image
body: <p>I am using Phonegap to retrieve a camera picture and then output it on a HTML5 canvas. </p>
  
  <p>Everything works well if I use the back camera, but if I use the front camera, the image shows up upside down.</p>
  
  <p>Has anyone encountered this problem? Any ideas as to why this is happening?</p>
  
  <p>Is there any way I can find out which camera was used to take the picture?</p>
  
  <p>Following is my code:</p>
  
  <pre><code>//take picture on click
  $("#camera").click(function(){
      //Take picture using device camera and retrieve image as base64-encoded string
      navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50 });
  })
  
  // Called when a photo is successfully retrieved in base64 format.
  // It draws the photo on the canvas.
  function onPhotoDataSuccess(imageData) {
      var imageObj = new Image();
      imageObj.onload = function(){
          drawImage(cbook, this);
      };
      imageObj.src = imageData;
  }
  </code></pre>
  
  <p>Thanks.</p>