Sitefinity 4.0 Dynamic Image Resize URL
Hi guys,
I have a quick question related to dynamic "on the fly" image resizing by accessing a image asset by URL with query strings for the width and height.
In Sitefinity 3.x, it was possible to do this by adding the following to the asset's URL.
http://domain.com/libraries/library_name/image_name.sflb?width=640&height=480&proportional=true
However, in Sitefinity 4.0, these query string parameters seem to have no effect on the image.
http://domain.com/images/tiles/2010/12/01/image.jpg?width=640&height=480
Is this still supported in Sitefinity 4.0? Or is there another URL scheme to handle this.
Note: Our designers loved the 3.x approach, as it meant they could represent multiple sizes with a single image asset. :D
Kind Regards
Haydn
Hello Haydn,
Please take a look at this article Images and Documents Overview
Best wishes,
Ivan Dimitrov
the Telerik team
The URL has changed since this thread began making for a very misleading assumption that it is not possible to do. The new URL with the detail is here:
http://www.sitefinity.com/40/help/developers-guide/sitefinity-essentials-modules-media-modules.html
I could not find any information on the link posted by Allen (and the link from Ivan has expired). So is this functionality built into sitefinity still? Judging by Allen's comment, I'd assume it was, but, I couldn't find any documentation about resizing via query string in the Media Modules overview. If it is still supported, what article within the developers guide in particular relates to it?
ARG DOUBLE POST... The sitefinity forums often tell me there was an error posting even if there wasn't... that's the cause for the double post anyway...
Sitefinity now has a size parameter you can use to resize an image, like
/images/default-album/myimage.png?size=800
however it is not yet a recommended feature as it is not fully matured. currently it will resize on demand for every request (no caching) meaning you'll take a performance hit on every load. There are plans to improve this story, but I'm not sure when they are scheduled to be implemented.
However, if you're trying to show a thumbnail a better suggestion would be to add the .tmb extension to the image src
/images/default-album/myimage.png.tmb as this uses the actual thumbnail that was generated when you initially uploaded the image.
I hope this is helpful!
Has the .tmb format gotten better? I have had trouble in the past where the thumbnail (even from a modestly-sized image) was pretty poor quality. However, I have also seen the same result with adding the size attribute. Is there a certain dpi that is optimal for the best scaling? Most of my images are at 96dpi and I don't know if it handles 72dpi better or not. Either way, for now, I usually create multiple images optimized to the size. It isn't the optimal way code-wise, but it is the only way I have been able to guarantee consistent quality.
Hi,
I use the 'size' parameter with 4.x and 5.0 versions.
Recently i've upgraded from 5.0 to 5.0 SP1 and now suddenly the size parameter has no effect.
Hi,
I use the 'size' parameter with 4.x and 5.0 versions.
Recently i've upgraded from 5.0 to 5.0 SP1 and now suddenly the size parameter has no effect.
Lev,
it appears this feature is now "opt in" due to the current performance limitations. I'm sure this will be changed once the feature matures.
In the meantime you can restore the functionality by taking a look at this KB article: Resizing images through the URL does not work after upgrade to 5.0 SP1
hope this is helpful, thanks for reporting this issue!
Sitefinity need to look into implementing something like Nathanael's Imageresizer into the product as manipulating images on the fly for different UI is a frequent thing to do in in a CMS:
http://imageresizing.net/