Retrieve Image Extension

Avatar

Avatar
Validate 10
Level 2
v1101
Level 2

Likes

4 likes

Total Posts

150 posts

Correct reply

0 solutions
Top badges earned
Validate 10
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 10
Level 2
v1101
Level 2

Likes

4 likes

Total Posts

150 posts

Correct reply

0 solutions
Top badges earned
Validate 10
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile
v1101
Level 2

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
Establish
MVP
Ravi_Pampana
MVP

Likes

197 likes

Total Posts

243 posts

Correct reply

75 solutions
Top badges earned
Establish
Contributor
Shape 1
Ignite 5
Ignite 3
View profile

Avatar
Establish
MVP
Ravi_Pampana
MVP

Likes

197 likes

Total Posts

243 posts

Correct reply

75 solutions
Top badges earned
Establish
Contributor
Shape 1
Ignite 5
Ignite 3
View profile
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)