onevcat/Kingfisher

Error Retrieving resource succeeded, but this source is not the one currently expected.

Alex22891 opened this issue · 0 comments

Check List

Thanks for considering to open an issue. Before you submit your issue, please confirm these boxes are checked.

Issue Description

I am encountering the error Retrieving resource succeeded, but this source is not the one currently expected.

[Tell us about the issue]
I am using kingfisher for image processing. My code is as follows:
if let coverUrlString = song.cover?.bigCoverUrl {
songImageView.kf.setImage(with: coverUrlString, options: [
.callbackQueue(.mainAsync),
.processingQueue(.mainCurrentOrAsync),
.backgroundDecode,
.transition(.fade(0.2)) // Smooth appearance of the image
]) { [weak self] result in
guard let self = self else { return }

            switch result {
            case .success(let imageResult):
                let image = imageResult.image
                self.popupItem.image = image
                
                // Pass the image to the function to get the average color
                let averageColor = self.getAverageColor(from: image)
                self.updateGradientColors(to: averageColor)
                
            case .failure(let error):
                print("Error loading image: \{(error.localizedDescription)")
                self.songImageView.image = .songOutline397
                self.popupItem.image = .songOutline40
            }
        }
    } else {
        self.songImageView.image = .songOutline397
        self.popupItem.image = .songOutline40
    }

The image is loaded and displayed in the interface, but the console is rushing errors.
Error loading image: Retrieving resource succeeded, but this source is not the one currently expected. Result: RetrieveImageResult(image: <UIImage:0x30097d7a0 anonymous {1440, 1440} renderingMode=automatic(original)>, cacheType: Kingfisher.CacheType.memory, source: Kingfisher.Source.network(Kingfisher.KF.ImageResource(cacheKey: “https://images.moosic.io/track/default_cover/98.jpg”, downloadURL: https://images.moosic.io/track/default_cover/98.jpg)), originalSource: Kingfisher.Source.network(Kingfisher.KF.ImageResource(cacheKey: “https://images.moosic.io/track/default_cover/98.jpg”, downloadURL: https://images.moosic.io/track/default_cover/98.jpg))), data: (Function)). Resource: network(Kingfisher.KF.ImageResource(cacheKey: “https://images.moosic.io/track/default_cover/98.jpg”, downloadURL: https://images.moosic.io/track/default_cover/98.jpg)).