PhotoViewer
PhotoViewer copied to clipboard
Memory problem with many pictures
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
Hello, we solved it this way:
- when creating the source, load images using [UIImage imageWithContentsOfFile:]
- 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