0

My application downloads JPEG images from the web and save them to the device using UIImageWriteToSavedPhotosAlbum. All works fine except for one issue: when I browse iPhone's photo library with iPhoto, some images have no thumbnails -- an empty dashed rectangle is displayed instead. Those JPEG images application downloads are also generated by my application as a result of processing pictures either taken by device camera or picked from Photo Library. Maybe I need to do something special during image processing that will make thumbnails visible?

sgosha
  • 1,279
  • 12
  • 19

1 Answers1

1

Try something like

UIImage  * original = [UIImage imageNamed:@"sample.jpg"];     /*  make image from CGRef  */
NSData   * imdata   = UIImagePNGRepresentation ( original );  /*  get PNG representation  */
UIImage  * png      = [UIImage imageWithData:imdata];         /*  wrap UIImage around PNG representation  */
UIImageWriteToSavedPhotosAlbum(png, 
                               self, 
                               @selector(image:didFinishSavingWithError:contextInfo:),
                               nil);

This will convert your image to PNG, and the thumbnail will show in Photos.app.

WrightsCS
  • 49,871
  • 22
  • 132
  • 180