|
||
This chapter describes how you can resize product images. Please note that you can resize any image the following way using the respective methods (i.e. GetImage() and GetImageByUrl() ) with appropriate parameters.
You can set a size of the original image (width: 422px, height: 266px) using the GetSKUImageUrl method in the following ways:
•Setting the Maxsidesize value
•Setting the Width and Height values
This sets the longer side to the value specified as Maxsidesize. The other side is calculated automatically, and so the aspect ratio remains the same as it is in the original image. In the following image, Maxsidesize is set to 240px.
GetSKUImageUrl(240) |
This sets the height of an image. The width is calculated automatically, and so the aspect ratio remains the same as it is in the original image. In the following image, Height is set to 170px.
GetSKUImageUrl(0,170) |
This sets the width of an image. The height is calculated automatically, and so the aspect ratio remains the same as it is in the original image. In the following image, Width is set to 200px.
GetSKUImageUrl(200,0) |
The given values are set on condition that they are not greater than the original size of an image. Please note that the aspect ratio may not be maintained. In the following image, Width is set to 150px and Height is set to 240px.
GetSKUImageUrl(150,240) |
In the following image, Width is set to 240px and Height is set to 150px.
GetSKUImageUrl(240,150) |
If at least one value is greater than the original size, the original image size is set. In the following image, Width is set to 600px and Height is set to 500px.
GetSKUImageUrl(600,500) |