SVG assets are not converted to PNG or JPEG using the format modifier in Dynamic Media OpenAPI
When using Dynamic Media OpenAPI, the format modifier does not convert SVG source assets to PNG or JPEG. This article explains the reason and provides steps to deliver rasterized versions of SVG assets.
Description description
Environment
- Adobe Experience Manager Assets as a Cloud Service
- Dynamic Media with OpenAPI enabled
Issue/Symptoms
- When a delivery URL requests PNG output for a JPEG source asset, the service returns PNG. When the source asset is SVG, requesting PNG or JPEG output returns the original SVG without rasterization.
- If no pre-generated PNG or JPEG rendition is available for the SVG asset, the request returns an error, or the asset might not display as expected.
Cause
Dynamic Media with OpenAPI doesn’t rasterize SVG source assets to PNG or JPEG on request. The delivery service returns the original SVG. To deliver a raster format for an SVG asset, use a pre-generated PNG or JPEG rendition.
Resolution resolution
Follow the steps below to address the issue:
-
In AEM Assets, check whether a pre-generated PNG or JPEG rendition exists for the SVG asset.
-
If a pre-generated raster rendition exists, use Adobe’s pre-generated rendition Delivery API with the asset ID and rendition name. See Delivery APIs for the endpoint details.
-
If no PNG or JPEG rendition exists, create one for the SVG asset:
- Open the SVG asset in AEM Assets.
- Use the Create Rendition option to generate a PNG or JPEG rendition.
- Save the rendition.
- Alternatively, convert the SVG file to PNG or JPEG using an external tool and upload the converted file as a new asset in AEM Assets.
-
Use the delivery URL of the PNG or JPEG rendition when serving the asset through Dynamic Media OpenAPI.
-
Verify that the asset is delivered in the expected raster format by accessing the rendition URL.