PhotoViewer icon indicating copy to clipboard operation
PhotoViewer copied to clipboard

Memory problem with many pictures

Open kozik opened this issue 12 years ago • 1 comments

Hello, I have a problem with the memory managment. I get a memory warning after scroll about 50 pictures. In total, they have about 270 of them, each weighing approximately 100 kb and is different from others. I tried to resolve this problem by issue # 6, but nothing helped. Please help me. Regards Kozik

kozik avatar Oct 09 '13 07:10 kozik

Hello, we solved it this way:

  1. when creating the source, load images using [UIImage imageWithContentsOfFile:]
  2. in file EGOPhotoImageView.m in method (void) setPhoto: (id <EGOPhoto>) aphoto, change the code to:
if(self.photo.image) {
        CGSize newSize = CGSizeMake( self.photo.image.size.width, self.photo.image.size.height );
        UIGraphicsBeginImageContext( newSize );
        [self.photo.image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
        UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();

        self.imageView.image = newImage;
} else {

Best regards! http://mstudio.pl

mstudiopl avatar Oct 17 '13 12:10 mstudiopl