pinterest / PINRemoteImage

A thread safe, performant, feature rich image fetcher
Apache License 2.0
4.01k stars 511 forks source link

Issue with cache cost calculation for UIImage created from Core Image #607

Open rounak opened 3 years ago

rounak commented 3 years ago

We are using PINRemoteImage's processorBlock to download an image from a URL, and then processing it using Core Image. We return UIImage(ciImage: processedCoreImage) in the processorBlock.

However we're hitting an NSAssert in PINRemoteImage during cache cost calculation:

NSAssert(container.image == nil || imageRef != NULL, @"We only cache a decompressed image if we decompressed it ourselves. In that case, it should be backed by a CGImageRef.");

It seems like this only supports UIImage that is CGImage backed, which is not the case with Core Image. Any help or guidance would be appreciated, thanks!

noorbhatia10 commented 6 months ago

Hey @rounak , did you find any solution for this?