resizer icon indicating copy to clipboard operation
resizer copied to clipboard

SqlReader removed from V5

Open edavis1993 opened this issue 3 years ago • 1 comments

We're currently on V4 looking to upgrade but we use ImageResizer to pull all our images from our database using the SqlReader plugin. In the change log it says this plugin has been removed. Are we just stuck on V4 now or is there a workaround?

edavis1993 avatar Jan 19 '23 21:01 edavis1993

SqlReader became unwieldy and untestable due to supporting such a wide variety of situations. Not many people use it anymore, either. That said, we tried to maintain backwards compatibility with existing blob providers, so you should be able to copy/paste the V4 class file into your project and rename it: https://github.com/imazen/resizer/blob/support/v4/Plugins/SqlReader/SqlReader.cs

If you want, you could trim it down to what you actually use, or reimplement it.

Inheriting from ImageResizer.Storage.BlobProviderBase and implementing Task<Stream> OpenAsync(string virtualPath, NameValueCollection queryString) is the typical way.

lilith avatar Jan 20 '23 17:01 lilith