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

CIImageProcessor not applied to downloaded image #485

Closed
vzsg opened this issue Oct 18, 2016 · 2 comments
Closed

CIImageProcessor not applied to downloaded image #485

vzsg opened this issue Oct 18, 2016 · 2 comments

Comments

@vzsg
Copy link

vzsg commented Oct 18, 2016

I'm trying to follow the "Create a processor from CIFilter" example from the cheat sheet with Kingfisher 3.1.3, but the filter is not getting called.

My processor class is here. And here's how I try to use it:

let url: NSURL = ...
imageView.kf.setImage(with: url,
                           placeholder: nil,
                           options: [.processor(WhiteToTransparentProcessor())])

The filter function is never called, the image appears in its original form. The .forceRefresh option has no effect on it, so it's not caching related. (The filter works elsewhere.)

Stepping through the source, I found something suspicious at Filter.swift line 49: in the .data case, the original image is decoded and returned, without touching the filter.

Hacking in ?.kf.apply(filter) at the end of the line fixed it temporarily. I will override process as a more stable workaround.

Is this intentional in any way (and I'm missing a vital step somewhere), or is this a bug that can be fixed in the library?

@onevcat
Copy link
Owner

onevcat commented Oct 19, 2016

@vzsg You are right. It is a bug and I will give it a fix soon. Wait for 10 mins!

@onevcat
Copy link
Owner

onevcat commented Oct 19, 2016

Fixed in 3.1.4.
@vzsg Thank you!

@onevcat onevcat closed this as completed Oct 19, 2016
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

2 participants