When a product has an image uploaded, the image can be used for example in a Configurator or on a Dashboard.
The URL to retrieve the image has the following pattern:
/pricefx/<partition>/productimages.get/<sku>?predefinedSize=<sizePreset>
or
/pricefx/<partition>/productimages.get/<sku>?width=<widthInPx>&height=<heightInPx>&type=<resizeStrategy>
-
"thumbnail" – Default values are width = 32, height= 32.
-
"enlarged_thumbnail" – Default values are width = 124, height= 124.
-
"product_detail" – Default values are width = 800, height= 600.
-
FIXED_WIDTH – Resizes the height accordingly to the aspect ratio of the original image.
-
FIXED_HEIGHT – Resizes the width accordingly to the aspect ratio of the original image.
-
BOXED_SIZE_CROP – Resizes the image to fill the specified box size – the image is cropped.
-
BOXED_SIZE_FIT – Resizes the image keeping the aspect ratio and fitting the longest size to the specified box.
Technical Notes:
-
This will work only for authenticated users in the same partition.
-
You can specify the image size in the URL so that the image is not retrieved in its full size and resized in the browser.
-
The resized images are cached using the standard HTTP caching making them quicker to load next time.