Images API v1
WARNING
This Images API version is depreciated in favor of the Images API version 2 which provides more capabilities. We recommend you to use the newest version.
What is the images API ?
The Images API v1 allows to transform images, like resizing, changing the format, the quality...
Transformations
This can simply be done by adding params to the image url. For example adding ?width=500&height=500
at the end of the url will resize the image in 500x500 pixels. You can view it in the application, just do right click on image in Product-Live and the click on Copy image url, then past it in a new tab, you will see parameters at the end of the image. You can change this parameters, the click enter to update the url, and you will see the file updated.
You can pass all these parameters:
Parameter | Description | Example |
---|---|---|
width | The width in pixels | ?width=500 |
height | The height in pixels | ?height=500 |
format | You can use png | jpg | webp | ?format=jpg |
quality | A number between 1 (the worst) and 100 (the best) | ?quality=90 |
Images metadata
There are several types of metadata associated with images:
- IPTC Core & Extension: Image basic information, like copyright, author name, image name, etc.
- Exif: Information most often produced by digital cameras, such as date taken, GPS position, etc.
- XMP: This is the newest format. It allows the creation of custom metadata.
All the metadata is kept within the original file and present when it is exported. However, this metadata is not transmitted to the resized image and is therefore not available within it.
Advanced
In the Export Items task, each images are exported like in this example:
xml
<Table key="PRODUCTS">
<Items>
<Item partition="ACTIVES" created="2019-04-10T13:40:23.83" updated="2019-04-10T13:40:23.83">
<Identifier key="EAN_13">1234567890123</Identifier>
<Field key="MAIN_IMAGE" width-px="2000" height-px="2000" size-kb="2456" original-file-name="1234567890123_front.jpg" file-hash="0CMqLzPax2h9W/zAdG2x0g==">https://asset.prod.product-live.com/file-map-resize/5f4cbec076e7f97f452f4234_documents/redirect/f8657387c7fe34a1799660b0396e1a95363fe2f60af0220525f53056ed34dbee</Field>
</Item>
<Item partition="ACTIVES" created="2019-04-10T13:40:23.83" updated="2019-04-10T13:40:23.83">
<Identifier key="EAN_13">1234567890124</Identifier>
<Field key="MAIN_IMAGE" width-px="2000" height-px="2000" size-kb="2456" original-file-name="1234567890124_front.jpg" file-hash="0CMqLzPax2h9W/zAdG2x9g==">https://asset.prod.product-live.com/file-map-resize/5f4cbec076e7f97f452f4234_documents/redirect/b9331f2153476ec7j0a3e14d7a3c85945bbdd74fa5a06bf0b7e360dd2bc0399d</Field>
</Item>
</Items>
</Table>
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
What you will have to remember:
- The value starting with
https://asset.prod.product-live.com/
is the public url for the original file uploaded. - The
file-hash
property is the MD5 of the file which is a unique value for each file.
When you are connecting Product-Live to your systems, using the file-hash of the file is a best practice. This file hash must be stored on the system, this way you will never download twice the same file.
Warning
The Images API must not be used directly from a frontend or any other software that needs high read capabilities. It must be used with Data Factory to resize and rename images before sending them to a CDN.
To learn more read Content Delivery Strategy