Developer forum

Forum » Ecommerce - Standard features » Resize image to fit an area

Resize image to fit an area

Adrian Ursu
Reply

Hello guys,

I was wondering if there is any way ot use the GetImage processor to resize an image to a specific size but fill out and center the image if the image has a different aspect ratio.

To be exact, if I have an image of 800x300 pixels, and I want to fit it into an area of 300x300 I want the system to create a 300x300 pixels image with a centered resized version of my image instead of getting a 300x112 pixels image.

Is that possible? I know that umbraco has something similar and they are using an additional parameter called "pad" to define if the system should fill the remaining area after resize.

Thanks a lot,

Adrian


Replies

 
Nuno Aguiar
Reply

Hi Adrian,

 

Did you manage to get this working?

 

Best Regards,

Nuno Aguiar

 
Adrian Ursu
Reply

Hi Nuno,

No. I could not find any scenario that could help me with that.

Funny thing, Umbraco already has somethiing like that for free :)

 
Nicolai Høeg Pedersen
Reply

Umbraco uses http://imageresizing.net/ and it works on all .NET platforms including Dynamicweb.

 
Morten Bengtson
Reply

Another great (and free) alternative is ImageProcessor, which is easy to set up, has a bunch of features and is extensible.

You could use URL rewriting in order to "hijack" all existing requests that make use of GetImage.ashx ;-)

 
Adrian Ursu
Reply

Well, these are nice alternatives. Thank you very much for that.

What we miss in GetImage.ashx is the "pad" attribute.And also the Adaptive/responsive way to deal with images.

Thank you all for the suggestions.
Adrian

 

You must be logged in to post in the forum