imazen / resizer

The official repository for ImageResizer
http://imageresizing.net/
Other
566 stars 172 forks source link

SqlReader removed from V5 #453

Open edavis1993 opened 1 year ago

edavis1993 commented 1 year ago

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?

lilith commented 1 year ago

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.