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

Support caching original images on a different cache #794

Merged
merged 5 commits into from
Oct 21, 2017
Merged

Support caching original images on a different cache #794

merged 5 commits into from
Oct 21, 2017

Conversation

yigitcanyurtsever
Copy link
Contributor

@yigitcanyurtsever yigitcanyurtsever commented Oct 20, 2017

Hey hey 👋,

Here at Zeplin, we needed a way to cache the original images on a different cache (rather than the target cache) when using a custom image processor. For example, we are fetching images with a custom thumbnail image processor, and we want to store these thumbnails on a 'thumbnail' cache, and store the originals on a 'snapshots' cache.

To accomplish this, we wrote a originalCache to KingfisherOptionsInfoItem on our fork. originalCache is basically used for storing and retrieving original images if paired with a non-default image processor. It defaults to targetCache to make it an optional item.

I've also included a typo fix and an optimization to prevent double caching if cacheOriginalImage is selected when used with the default image processor.

Thought this may be a good addition to the main repo. I wasn't able to write or run any tests because of the missing Kingfisher-TestImages folder.

@onevcat
Copy link
Owner

onevcat commented Oct 20, 2017

@yigitcanyurtsever Thanks for it. It looks promising. I would take a look at it later.

BTW, for the testing images, you could take a look at https://github.com/onevcat/Kingfisher#developments-and-tests

@yigitcanyurtsever
Copy link
Contributor Author

@onevcat Thanks for looking at it! I've updated the PR with some tests.

By the way, I didn't know that it was recommended to open a discussion first – sorry about that.

@onevcat
Copy link
Owner

onevcat commented Oct 21, 2017

@yigitcanyurtsever No problem, bro!

The code looks very nice and I am so glad to merge it. I will prepare an update for it now.
Thank you!

@onevcat onevcat merged commit acb039d into onevcat:master Oct 21, 2017
@yigitcanyurtsever yigitcanyurtsever deleted the original-cache branch July 12, 2018 19:40
petarlazarov pushed a commit to dowjones-mobile/Kingfisher that referenced this pull request Oct 6, 2021
Support caching original images on a different cache
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

Successfully merging this pull request may close these issues.

2 participants