Developer forum

Forum » Development » eCom Image resize

eCom Image resize


Reply

Hi,

 

I'm trying to figure out how to resize every productimage in a shop to either a defined max-width or max-height so every image will fit into the same box without cropping the image or changing the aspect ratio.

 

FX:

Target box size:

Max-width: 150px

Max-height: 100px

 

Original image 1:

Orig-width: 500px (will be resized to 150px = max-width)

Orig-height: 300px (will be resized to 90 px, since the aspect ration should be maintained)

 

Original Image 2:

Orig-width: 200px (will be resized to 67px, maintain aspect)

Orig-height: 300px (will be resized to 100px = max-height)

 

Is this possible with the ../Public/GetImage.aspx?Image=%2fFiles%2fBilleder%2f[ImageName]&Width=[pixels]&Height=[pixels]. way or are there any other ways of doing this?


Replies

 
Reply
Yes, that is possible. Simply specify a value for the fixed axis, and the resizing method will scale the other based on the aspect ratio.

 

You must be logged in to post in the forum