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

Dynamic specify Image paths #53

Open
xMANIGHTx opened this issue Jun 22, 2020 · 4 comments
Open

Dynamic specify Image paths #53

xMANIGHTx opened this issue Jun 22, 2020 · 4 comments

Comments

@xMANIGHTx
Copy link

It would be nice to be able to specify image paths dynamically from code.
I'm trying to implement WebRSize in my custom CMS which has plugins and widgets which will have their own image folders.
I have global application variables and plugins variables read at application start as static variables, so for example I could pass the folders to the module from there.
At the moment it seems this functionality is not provided and the only way is static in web config right?

@saucecontrol
Copy link
Owner

Yeah, for now it's only configurable from web.config, but I like your idea for an injectable folder config.

I built WebRSize originally for one specific use case, so I haven't put a lot of thought into what kinds of extension points it should have to give it wider appeal. I'll be thinking more through that as I work on a plan for a .NET Core version of it, but that's still a lower priority than some other things I have on my to-do list, so it could be a while.

Would you be interested in working on a PR for code-based folder config in the meantime?

@xMANIGHTx
Copy link
Author

I could be interested by I'm a total noob about github, branches, wathever and I'm relatively new to oop as well so I would write terrible code :) But I was thinking about recompiling your code in visual studio, modifying the httpmodule to read folders from my global variables rather than web.config... but I don't know how this could be translated to a more general solution.....
Since, as I said, I'm a noob coder, the first thing that comes to my mind is just to have a static or cached list of strings, that the httpmodule will read together or before/after accessing the web.config. That would be a straightforward implementation but I'm sure it will defy at least a dozen of best practices :)

@saucecontrol
Copy link
Owner

Definitely for a proof-of-concept or a short term solution, you could just modify your own copy of WebRSize. I believe you would only need to change the WebRSizeModule to do what you propose.

I recently modified the MagicScaler project to use some new C#9 features, so you'll need the latest VS 2019 Preview version to build all the dependencies, but it's straightforward other than that.

@xMANIGHTx
Copy link
Author

Thanksa again very much appreciated

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

No branches or pull requests

2 participants