开发者

How to modify an image before caching it with HJCache?

开发者 https://www.devze.com 2023-04-07 12:36 出处:网络
I\'ve been using HJCache to do asynch image loading and caching. It works great, but I have use case开发者_运维问答 where I can\'t seem to get HJCache to handle.

I've been using HJCache to do asynch image loading and caching. It works great, but I have use case开发者_运维问答 where I can't seem to get HJCache to handle.

I have an images loaded in a table view, and the same images appears bigger when you select the corresponding tableviewcell. HJCache does a great job of caching the image so it doesn't have to reload it after getting it once. However, I would like to resize the image (and do some cropping, etc) in the tableview thumbnail. The problem is, that it's a very expensive task to do and it ends up lagging the scrolling of the tableview if it's done in the drawRect of the cell.

I would like to cache the "modified" image along with the original so that the image processing only has to happen once. How do i get an instance of the already cached UIImage, apply the processing, and then add that one to the cache as well (with a different oid). I only seem to be able to cache an image by giving a URL.

Thank you, Matt

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号