Loading Iphone camera picture as texture using GLKTextureLoader in OpenGL ES 2.0
===

I would like to use an IPhone camera picture as texture for an OpenGl ES 2.0 app.
To reach this goal I have used the code below. However it fails to load the texture as it seems the image from the UIImagePickerController doesn't fulfill the expected format. However I cannot quite figure the solution. Has anyone met a similar issue and how did you solve it ? 

Thank you for any pointer you may have.
Cheers,
Stephane


    -(void)imagePickerController:(UIImagePickerController *)picker  didFinishPickingImage : (UIImage *)image  editingInfo:(NSDictionary *)editingInfo
    {
      NSData* imdata =  UIImagePNGRepresentation ( image );
      GLKTextureInfo *texture;     
      NSError *error;
      texture = [GLKTextureLoader textureWithContentsOfData:imdata options:nil error:&error];
    
      if (error) {
            NSLog(@"createTextureFromImagePicker has failed to load picked image: %@",error);    
      }
    
      [picker dismissModalViewControllerAnimated:YES];
    }

