Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

White Background after cache in disk #745

Closed
silvaric opened this issue Jun 6, 2014 · 1 comment
Closed

White Background after cache in disk #745

silvaric opened this issue Jun 6, 2014 · 1 comment

Comments

@silvaric
Copy link

silvaric commented Jun 6, 2014

I really don't understand why my png's images are with white background after i store in disk..

code

[_imageCacheChannel queryDiskCacheForKey:key done:^(UIImage *image, SDImageCacheType cacheType) {

        if (image) {

            completedBlock(image,nil);

        }else{

            /////////
            // *    Request Image
            /////////

            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

                [[SDWebImageDownloader sharedDownloader] downloadImageWithURL:ObjectOrEmptyString(url)
                                                                      options:SDWebImageProgressiveDownload
                                                                     progress:^(NSInteger receivedSize, NSInteger expectedSize) {}
                                                                    completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished) {

                                                                        if (finished){

                                                                            if (image) {
                                                                                [_imageCacheChannel storeImage:image forKey:key];
                                                                            }

                                                                            completedBlock(image,error);
                                                                        }
                                                                    }];
            });
        }
    }]

if i change the way to store to

 [_imageCacheChannel storeImage:image forKey:key toDisk:NO];

The image will be transparency like i want but i don't want to request the image every time i open the app (after kill) i want to store in the disk

@silvaric
Copy link
Author

silvaric commented Jun 6, 2014

I use this :

[_imageCacheChannel storeImage:image recalculateFromImage:NO imageData:data forKey:key toDisk:YES]

It resolved but is strange why i need to have this 'recalculateFromImage:NO' to have transparency after i get image from disk =/

Anyway sorry for the issue and thanks for the SDWebImage ;)

@silvaric silvaric closed this as completed Jun 6, 2014
bpoplauschi added a commit that referenced this issue Jun 19, 2014
devedup pushed a commit to FilmFlexMovies/SDWebImage that referenced this issue Sep 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant