Override AEM “AdaptiveImageServletMappingConfigurationFactory” for WebP support
Adobe Experience Manager (AEM)’s Image Component doesn’t render WebP assets unless the AdaptiveImageServletMappingConfigurationFactory configuration includes the WebP extension. Deploying a custom configuration using default naming and location fails because AEM continues to apply its out-of-the-box (OOTB) settings. To resolve the issue, rename the configuration file, place it in the correct folder, and redeploy your package.
Description description
Environment
Adobe Experience Manager (AEM) Managed Services, v6.5 - Sites
Issue/Symptoms
- The AEM Image Component doesn’t render WebP images on pages.
- A custom configuration meant to add WebP support gets ignored after deployment.
- The system keeps applying the default
AdaptiveImageServletMappingConfigurationFactorysettings instead of the custom configuration. - The WebP image assets stay unavailable even after deploying the updated configuration file.
Resolution resolution
Follow these steps to address the issue:
- Navigate to Tools
>Operations>Web Console>system/console/configMgron the AEM 6.5 AMS author instance… - Search for
AdaptiveImageServletMappingConfigurationFactory, then open and copy the configuration forcom.adobe.cq.wcm.core.components.internal.servlets.AdaptiveImageServletMappingConfigurationFactory coreimg. - Create or rename the code-based configuration file as
com.adobe.cq.wcm.core.components.internal.servlets.AdaptiveImageServletMappingConfigurationFactory coreimg.cfg.json. - In this file, include webp in the file extensions property, for example:
"fileExtensions": [ "jpeg", "jpg", "png", "gif", "webp"]. - Place this file under the author run mode folder in your codebase, for example:
.../apps/<project>/config.author/(and similarlyconfig.publish/if needed for publish). - Redeploy the code package.
- After deployment, verify in
/system/console/configMgr that com.adobe.cq.wcm.core.components.internal.servlets.AdaptiveImageServletMappingConfigurationFactory coreimgis active, and its file extensions list contains webp.
Related reading
- Adaptive Image Servlet in the AEM Core Components Guide
- Web-Optimized Image Delivery in the AEM Core Components Guide
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f