title: Crash the application while click the picture in sunlight in xoce
body: <p>I'm implementing the camera application feature in my iOS App, the problem is when I click the picture in <strong>sunlight</strong> it making my application crash but it is working fine in deamLight.</p>
  
  <p>My code for clicking the pictue</p>
  
  <pre><code>        loadingOutlet.hidden=NO;
          imagePicker = [[UIImagePickerController alloc]init];
          imagePicker.delegate=self;
          [imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera];
          [self presentViewController: imagePicker animated:YES completion:nil ];
          [self.view bringSubviewToFront:imageView];
  
          CameraPic=YES;
  </code></pre>
  
  <p>and this is for compressing the images when uploading on <code>UIImageView</code></p>
  
  <pre><code>-(void)loadImgInNSData
   {
       double size;
       int  compressionRatio=1;
       while ([imgDataCompressImg length]&gt;50000) 
       {
           size = [imgDataCompressImg length];
           compressionRatio=compressionRatio*0.5;
           imgDataCompressImg=UIImageJPEGRepresentation([[UIImage alloc]  initWithData:imgDataCompressImg],compressionRatio);
           NSLog(@"%i",[imgDataCompressImg length]);
          if (size-[imgDataCompressImg length]&lt;500000)
          {
              break;
          }
      }
  
  } 
  </code></pre>
  
  <p>please help me as soon as possible</p>