You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow passing custom Configuration instances to processors #650
I have verified that I am running the latest version of ImageSharp
I have verified if the problem exist in both DEBUG and RELEASE mode
I have searched open and closed issues to ensure it has not already been reported
Problem
At the moment it's not possible to pass Configuration instances to image processors. We can't do this without changing the public API which means we need to act before RC1 is out.
Suggestion:
IImageProcessor<T>.Apply() needs a Configuration argument
IImageProcessingContext<TPixel> should hold a Configuration instead of MemoryAllocator
We need overloads for Mutate() and Clone() taking a Configuration
@funcylambda thanks volunteering, and sorry for the late reaction!
Actually, I received some critical voices on this proposal from @JimBobSquarePants and @tocsoft, because it's possible to control the Configuration instances with the current API by binding them to Image<T> instances at initalization.
Their opinion is that it should be good enough for 1.0, mine is that we can add more flexibility with this feature. (IImageProcessingContext<T>.Configuration > Image<T>.Configuration > Configuration.Default)
I think a community PR won't do any harm here, because it won't distract the core team from our main priorities. @JimBobSquarePants@tocsoft thoughts?
Cool, and no worries! I'm probably going to be refactoring some imaging code from an old C# library to ImageSharp at work (you have some good publicity going around thanks to a few bloggers!), so I thought it'd be good to give back as it were, and also learn a bit more about the library. If this isn't a good task, I do have some spare time this weekend so feel free to point me in the direction of another one :)
@antonfirsov I actually thought this would be more disruptive than I thought but looking at the source it might well be ok. @funcylambda You have my blessing.
We'll have to also update ICloningImageProcessor<TPixel>.CloneAndApply.
Activity
funcylambda commentedon Sep 26, 2018
@antonfirsov - Do you mind if I take this one to get my feet wet with ImageSharp? :)
antonfirsov commentedon Oct 1, 2018
@funcylambda thanks volunteering, and sorry for the late reaction!
Actually, I received some critical voices on this proposal from @JimBobSquarePants and @tocsoft, because it's possible to control the
Configurationinstances with the current API by binding them toImage<T>instances at initalization.Their opinion is that it should be good enough for 1.0, mine is that we can add more flexibility with this feature. (
IImageProcessingContext<T>.Configuration>Image<T>.Configuration>Configuration.Default)I think a community PR won't do any harm here, because it won't distract the core team from our main priorities. @JimBobSquarePants @tocsoft thoughts?
funcylambda commentedon Oct 1, 2018
@antonfirsov
Cool, and no worries! I'm probably going to be refactoring some imaging code from an old C# library to ImageSharp at work (you have some good publicity going around thanks to a few bloggers!), so I thought it'd be good to give back as it were, and also learn a bit more about the library. If this isn't a good task, I do have some spare time this weekend so feel free to point me in the direction of another one :)
JimBobSquarePants commentedon Oct 2, 2018
@antonfirsov I actually thought this would be more disruptive than I thought but looking at the source it might well be ok. @funcylambda You have my blessing.
We'll have to also update
ICloningImageProcessor<TPixel>.CloneAndApply.funcylambda commentedon Oct 2, 2018
@JimBobSquarePants - Cool, I'll send a PR when it's done/message if I have any problems. Probably towards the end of Sunday.
SixLabors#650 Added Configuration as an optional param to IImageProce…
Allow custom configuration. Fix #650