问题
EDIT
I got it to work however I had to add the RemoteReader plugin. When I remove the AzureReader2 plugin from my project it still works which makes sense however what is the AzureReader2 plugin benefiting me?
ORIGINAL QUESTION
I have done everything that has been outline here (including the comments) but can't seem to figure out why I can't resize images on the fly with this plugin for imageresizer.
This is what my web.config entry under the element looks like:
<add name="AzureReader2" prefix="~/img/" connectionString="DefaultEndpointsProtocol=https;AccountName=[Account];AccountKey=[key]" endpoint="http://<account>.blob.core.windows.net/" />
and I have set up my container to be called 'img'.
When I go to this URL to test it out:
https://<account>.blob.core.windows.net/img/image.jpg?width=50
The image shows up but just in its regular size. I've also tried running this locally and on the live side AWS but still get no resizing :(
回答1:
ImageResizer library allows to serve modified versions of images (resized, cropped, rotated, with watermark etc.). AzureReader2 is a plugin that allows to fetch unmodified images from the Azure Blob (https://<account>.blob.core.windows.net
) as opposed to disk.
So URL which should be used to obtain modified version of an image is your application URL with ImageResizer library installed and not Azure Blob URL (in your example https://<account>.blob.core.windows.net/img/image.jpg?width=50
).
EDIT
AzureReader2 plugin allows you to read images from Azure Blob the same way as if they were saved in a disk. If you application is built in a way that all images are coming from Azure Blob, you can have two independent teams: one managing your images (and other media like CSS) and one managing your code. With that approach AzureReader2 plugin will be very handy.
I hope that will help.
回答2:
After hours of playing around I finally understand how it works. I didn't realize the prefix is what you tack on the end of the actual URL and not the BLOB store URL. I ended up with
http://<account>.azurewebsites.net/img/img/image.jpg?width=50
This worked instead of my original thinking of:
https://<account>.blob.core.windows.net/img/image.jpg?width=50
For anybody that's looking at this the prefix is whats tacked on the URL of the actual site and not the BLOB store!
来源:https://stackoverflow.com/questions/14675118/imageresizer-for-azure-using-azurereader2-plugin-not-resizing