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

Incorrect behaviour of image modifiers #1609

Closed
mcrakhman opened this issue Jan 30, 2021 · 4 comments · Fixed by #1612
Closed

Incorrect behaviour of image modifiers #1609

mcrakhman opened this issue Jan 30, 2021 · 4 comments · Fixed by #1612
Assignees
Labels

Comments

@mcrakhman
Copy link

mcrakhman commented Jan 30, 2021

Right now it seems imageModifiers change the finalImage which is cached in memory. This can be a problem when you are using the same image in multiple places. Please correct me if I am wrong. See ImageCache.swift. One of the options would be to not cache the final image (or at least add an option to not cache it), or add the same logic to modifiers as we have with processors, so different modifiers would have different keys.

let finalImage = options.imageModifier?.modify(image) ?? image
// Cache the disk image to memory.
// We are passing `false` to `toDisk`, the memory cache does not change
// callback queue, we can call `completionHandler` without another dispatch.
var cacheOptions = options
cacheOptions.callbackQueue = .untouch
self.store(
    finalImage,
    forKey: key,
    options: cacheOptions,
    toDisk: false)
@onevcat
Copy link
Owner

onevcat commented Jan 30, 2021

Ummm, I guess you are right on this. Let me think about how can we get it done.

@onevcat onevcat changed the title Incorrect (?) behaviour of image modifiers Incorrect behaviour of image modifiers Jan 30, 2021
@onevcat onevcat self-assigned this Jan 30, 2021
@mcrakhman
Copy link
Author

mcrakhman commented Jan 31, 2021

Will you be so kind and make a new release? This will help us greatly :-)

@onevcat
Copy link
Owner

onevcat commented Jan 31, 2021

Yes, I will tag it soon after adding more docs to other changes.

@onevcat
Copy link
Owner

onevcat commented Feb 1, 2021

Released in 6.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants