Developer forum

Forum » Feature requests » ImageResize canvas size

ImageResize canvas size

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Guys,

I believe I have requested this a few times already and I hoped I will see it in 9.2. Since I don't see it yet (or at least it has not been documented if it has been added) I will add the request again.

When you resize images using the GetImage.ashx option, there are a few useful options but also a missing one (at leats in my opinion). The option to create the image to the specifiez size and fill the canvas with a specific color. For example, If my resize call has a different aspect than the image I am resizing. The options I have are Fill (resize the image to fill completely the canvas I have asked for) which in some cases would mean zoom in the image and affect the quality, or Fit the image.

I definitely feel the need to have a final image of my specified size, with a background color I can specify. For example a new Crop option (7) plus a background color(#000000) would mean:

Create a canvas of size {width} and {height}, give it a color {color} and fit the image on it (vertical center, horizontal center).

I know, in the past, I have been suggested to build another processor on my own, but I feel this option should come from the platform as a native option and not as a custom one.

Fitting an image horizontal and vertical in a responsive world and doing it cross-browser it's difficul enough. Having this option could save a lot of time.

Thank you,

Adrian 


Replies

 
Nicolai Pedersen
Reply

Hi Adrian

You can specify &Background=ffffff and &DoNotUpscale=true - that should handle what you need...

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

That's awesome!

When was this introduced?

Thanks,

Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I could not make it work.

I am using DW 9.2.4.

If I put &DoNotUpscale=true, no resize is done. You can also test this behavior from the backed using the simulation from the developer section.

What combination of crop and background should achieve my description?

Thanks,
Adrian