Expand my Community achievements bar.

How to Accessing particular rendition of an Image uplaoded in aem dam using graphql

Avatar

Level 2

using GraphQL in aem i want to access the ootb rendered images that i can use for various screensizes,
Is it possible to access in that way or dynamic media requirement is mendatory for doing this.

AvinashRanjan_0-1733307775864.png

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

2 Replies

Avatar

Community Advisor

Hi @AvinashRanjan ,

 

 

You can add Image Rendition as well in the below code to get Appropriate image to display.

Here is detailed documentation.

https://experienceleague.adobe.com/en/docs/experience-manager-learn/getting-started-with-aem-headles... 

 

Cheers,

Aditya

 

 

query($path: String!, $imageFormat: AssetTransformFormat=JPG, $imageSeoName: String, $imageWidth: Int, $imageQuality: Int) {
  adventureByPath(
    _path: $path
    _assetTransform: {
      format: $imageFormat
      width: $imageWidth
      quality: $imageQuality
      preferWebp: true
    }
  ) {
    item {
      _path
      title
      primaryImage {
        ... on ImageRef {
          _dynamicUrl
        }
      }
    }
  }
}
 

 

 

Thanks,

Aditya Chabuku

Avatar

Level 2

Hi @Aditya_Chabuku , Thank you for your response. My mistake, I didn't mention the AEM version we are using. It seems you're referring to the web-optimized images feature, but according to the documentation, it's not supported for AEM 6.5. Is there an alternative for AEM 6.5 to provide rendered images or paths for different screen sizes for headless implmentation?

AvinashRanjan_0-1733330502000.png

Thanks,
Avinash