Closed
Description
- (UIImage *)diskImageForKey:(NSString *)key
{
NSData *data = [self diskImageDataBySearchingAllPathsForKey:key];
if (data)
{
UIImage *image = [UIImage sd_imageWithData:data];
image = [self scaledImageForKey:key image:image];
image = [UIImage decodedImageWithImage:image];
return image;
}
else
{
return nil;
}
}
what's the benefit of this approach instead of using CGImageSourceCreateWithData(CFDataRef data, CFDictionaryRef options)
directly ?
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
andrey-krukovskiy commentedon Mar 4, 2014
👍
Current solution uses much memory, and we experienced problems with it. Seems that it may results in crashes due to huge memory consumption in some cases.
I found that current solution was introduced by PR #33. But when we replace content of
decodedImageWithImage:
method with justreturn image;
it working not worse than early.phamquy commentedon Mar 10, 2014
i have the same question, but as stated in #33, "undecoded" will cause "visible delay". I think it would be better solution if we can opt out "forceDecode" option.
@andrey-krukovskiy what do you meant by "working not worse than early"?
andrey-krukovskiy commentedon Mar 10, 2014
I meant that no some visible delays were for me. May be for last 2 year performance of devices were increased, or may be I just miss it. I'm not sure in it, because I'm not performed special comparison for it.
mythodeia commentedon May 29, 2015
now there is the option
shouldDecompressImages
available for bothSDImageCache
&SDWebImageDownloader