tags:

views:

132

answers:

2

Hello,

I am saving image in the camera roll using UIImageWriteToSavedPhotosAlbum but always get an black thumbnail even if the picture is correct.

Do you have pointers to address this?

Thanks in advance for your help.

Regards,

+1  A: 

I had the same problem. Drawing the image within a UIGraphicsImageContext solves the issue:



  CGRect rect = CGRectMake(0,0,100,100);
  UIImage *image = ((put here your image));

  UIGraphicsBeginImageContext(rect.size);
  [image drawInRect:rect];
  UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
  UIGraphicsEndImageContext();  

  UIImageWriteToSavedPhotosAlbum(
      result, self, @selector(image:didFinishSavingWithError:contextInfo:),nil);

Lars Schneider
A: 

Related with image size ? in my case, size is (320,460) , then thumb image is black.

Forrest