New Kontent feature - Asset renditions, will be released soon (beginning of December with) and it will be available through DeliveryAPI. We should have them covered in SDKs as well.
Proposed solution
When the asset element is retrieved from Deliver, the referenced assets can now contain user-defined renditions and it is easy for the developer to apply the rendition query string to the URL of the original asset so that the customized image can be rendered in the UI.
Additional context
This is the updated Deliver contract for referenced assets of asset element:
New renditions property is present and it is a dictionary with a single key (for now) equal to the "default" preset codename. Presets are not a real entity for now but are part of the long-term vision of asset renditions.
the property will only be present for image-like objects (those which have both width & height properties set by the system)
when no renditions are defined for the linked asset, the empty object/dictionary is returned in the rendition property
if the asset is of non-image type (e.g. .pdf) the property won't be present (same as width & height in that case)
Ideally, to ease the adoption for the users, it would be nice to introduce support for "defaultPreset" which would automatically apply the query parameters of the rendition in preset specified by the global config.
Feel free to get inspired by the already implemented support in JS or .NET SDKs
Note, that this only applies to assets in the asset element. There is no support for renditions in inline RTE images, yet.
Motivation
New Kontent feature - Asset renditions, will be released soon (beginning of December with) and it will be available through DeliveryAPI. We should have them covered in SDKs as well.
Proposed solution
When the asset element is retrieved from Deliver, the referenced assets can now contain user-defined renditions and it is easy for the developer to apply the rendition query string to the URL of the original asset so that the customized image can be rendered in the UI.
Additional context
This is the updated Deliver contract for referenced assets of asset element:
renditions
property is present and it is a dictionary with a single key (for now) equal to the "default" preset codename. Presets are not a real entity for now but are part of the long-term vision of asset renditions.width
&height
properties set by the system)width
&height
in that case)