I am not using the media library to house my images. I am using an azure cdn. Right now, I am serving the same image resolution no matter what device. I was wondering what is the best way to scale and serve the image dynamically using .NET?
Thanks for the input. Do you know of a best way to determine the widths to use for different resolutions? I was thinking of using this for the img element srcset attribute?
but it still downloads the larger image instead of re-sizing it to 73x73.
I tried it on an image that is not on azure and it resized it, but if I try the width and height attributes on an image on azure, it downloads the original image.
Oh, I don't know about when getting the image from azure. But seems like you created another post for that already? :)
What I thought was that you had some images outside the "Media" section of Umbraco on your disk in a another folder, which could be "images" for instance. That scenario should work with the image processor if I'm not mistaken. But I have no clue about the azure thing.
Serve scaled images?
Hi,
I am not using the media library to house my images. I am using an azure cdn. Right now, I am serving the same image resolution no matter what device. I was wondering what is the best way to scale and serve the image dynamically using .NET?
Thanks
Hi Saied
You should be able to make use of the image cropper functionality even though the images are not picked using the image cropper in Umbraco.
You should be able to use path/toyourimage/image.jpg?width=210 for instance.
You can see the different parameter options here http://imageprocessor.org/imageprocessor-web/imageprocessingmodule/resize/
I hope this helps? :)
/Jan
Hi Jan,
Thanks for the input. Do you know of a best way to determine the widths to use for different resolutions? I was thinking of using this for the
img element srcset
attribute?I tried to do:
<img class="rsTmb" src="@string.Concat(Model.BaseImageUrl,Model.ProductImage1Url).GetCropUrl(73,73)" alt="">
and
<img class="rsTmb" src="@string.Concat(Model.BaseImageUrl,Model.ProductImage1Url)?width=73&height=73" alt="">
but it still downloads the larger image instead of re-sizing it to 73x73.
I tried it on an image that is not on azure and it resized it, but if I try the width and height attributes on an image on azure, it downloads the original image.
Hi Saied
Oh, I don't know about when getting the image from azure. But seems like you created another post for that already? :)
What I thought was that you had some images outside the "Media" section of Umbraco on your disk in a another folder, which could be "images" for instance. That scenario should work with the image processor if I'm not mistaken. But I have no clue about the azure thing.
/Jan
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.