Retrieve Image Extension

Avatar

Avatar

viki1101

Avatar

viki1101

viki1101

09-09-2020

Hello Community - We have an image component, in that authors will be selecting images. without having any separate field selection of the image type/extension in the dialog, I wanted to retrieve the selected image extension and based on that, we will perform some logic. is there a way to retrieve the image extension of the selected image in HTL.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Ravi_Pampana

MVP

Avatar

Ravi_Pampana

MVP

Ravi_Pampana
MVP

09-09-2020

Hi,

 

Check below code to get the image extension from image resource

 

Image image = new Image(resource); // resource - image resource

image.getExtension();

 

For more details, please refer

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/co...

Hope this helps!

Answers (0)