GetCropUrl Returns Only the Url Paramaters for Azure Blob Storage Images
Hi,
I have a 7.15.1 install and I've gone through all the steps to setup Azure storage with these instructions.
I'm using the Image Cropper data type to add an image to my content with 4 different crops. Everything seems to work. It creates 2 files in my azure storage one with the name of the file and one with the name of the file _thumb.
The problem is that when I use Image.GetUrlCrop("mycropname") it only returns the url params, for example,
"?anchor=center&mode=crop&width=250&height=150"
If I use just Image.ToHtmlString(), then the image works but it's not cropped, and the image appears to be coming from Azure.
Does anyone have any suggestions on what I might be doing wrong?
There's a lot better way to do that last step, but that's the general idea. Also, another way is to do a URL rewrite which is probably a lot faster. However, it was helpful for me to build this url myself so that I understood what's going on.
GetCropUrl Returns Only the Url Paramaters for Azure Blob Storage Images
Hi,
I have a 7.15.1 install and I've gone through all the steps to setup Azure storage with these instructions.
I'm using the Image Cropper data type to add an image to my content with 4 different crops. Everything seems to work. It creates 2 files in my azure storage one with the name of the file and one with the name of the file _thumb.
The problem is that when I use Image.GetUrlCrop("mycropname") it only returns the url params, for example,
"?anchor=center&mode=crop&width=250&height=150"
If I use just Image.ToHtmlString(), then the image works but it's not cropped, and the image appears to be coming from Azure.
Does anyone have any suggestions on what I might be doing wrong?
I'm not using a CDN, do I have to do that?
Thank you for your help!
Just in case anyone has the same issue. The way I fixed my problem was to piece together the correct url to remote.axd to get the image to work.
It needs to look like (I have my localhost in there, but yours will be different):
So to do this I put together the path to the image file without the domain:
This gets: /media/1003/myimage.jpg?center=0.34,0.464&mode=crop&width=250&height=150
Then I just needed to add in the domain, the port (in my case for local), and the reference to "/remote.axd?"
There's a lot better way to do that last step, but that's the general idea. Also, another way is to do a URL rewrite which is probably a lot faster. However, it was helpful for me to build this url myself so that I understood what's going on.
What type is
Image
in your code and how do you retrieve it's value from the model?The Image is an Image Cropper data type, it's an element in my IPublishedContent Doc Type which I'm referring to as "item" up above.
If you want the full Url you need to get it trough the UrlHelper:
is working on a reply...