Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Forcing image size increase on GetImage View modes: 
User avatar
Member
Member
eric.savage-clyral - 1/9/2013 3:42:15 AM
   
Forcing image size increase on GetImage
We have images with variable aspect ratio, and I am using the following to set them all to the same width in the transformation:

<%# GetImage("ClientLogo", 190) %>

However, I see this doesn't increase the size of an image beyond it's existing width. Is there a way to force smaller images to increase to the required width?

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 1/9/2013 9:27:35 AM
   
RE:Forcing image size increase on GetImage
Hi Eric,

Unfortunately not. This functionality is not supported, only the down-sizing is possible at the moment. However there is an another way... you can put an in-line style to your image so after that you will be able to set the image size via css.

I hope this will help you.

Best regards,
Martin Danko

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 1/9/2013 9:46:22 AM
   
RE:Forcing image size increase on GetImage
In regards to your code sample, setting the max side (190) will only resize (down) if the image has a side larger than 190px. So if your image was 150px, it won't scale it up.

Do you have image size limitations set in SiteManager>Settings>Files>Image resizing? If so, you'd have to be careful about going over that limit otherwise it would be a waste of setting the value.

To answer your question, I'd suggest creating your own method that utilizes the CMS.GlobalHelper.ImageHelper class.