Searching images in DAM with image size as size criteria | Community
Skip to main content
October 16, 2015
Solved

Searching images in DAM with image size as size criteria

  • October 16, 2015
  • 2 replies
  • 1314 views

Hi ,

We are trying to implement the functionality to search images in DAM based on image size as search critera . But i was not able to find the details of image size  under  'metadata' node of an image in CRX  . 
1.Can someone let me know , where the image size details are stored in CRX ?
2. How to add search functionality for image size ?

Thanks in advance 

Prabhu

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

*   It should be stored under metadata. Probably your asset has wrong meta data set Ex:-  tiff:ImageWidth, tiff:ImageLength set to zero instead of actual size. Check with image generated camera or source that proper metadata is set.    If you feel meta data is set correctly file a daycare will validate.

*     http://dev.day.com/docs/en/cq/current/dam/extending-cq-dam-search.html should help to extend search.

2 replies

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

*   It should be stored under metadata. Probably your asset has wrong meta data set Ex:-  tiff:ImageWidth, tiff:ImageLength set to zero instead of actual size. Check with image generated camera or source that proper metadata is set.    If you feel meta data is set correctly file a daycare will validate.

*     http://dev.day.com/docs/en/cq/current/dam/extending-cq-dam-search.html should help to extend search.

October 16, 2015

Thanks Sham . I figured it out , the image details are stored under metadata/dam:size property . 

For extending search , i need to create a custom facet to search dam based on asset size . 

1. What is the best approach to create a custom facet ? 

I tried overlaying /libs/cq/ui/widgets/source/widgets/wcm/PropertyPredicate.js and customized the Propertypredicate.js javascript as per my requirement .

2.Now , I need to create JCR Predicate expression to genarate XPATH query . Please find a sample predicate expression 

http://localhost:4502/libs/cq/search/content/querydebug.html 

type=dam:Asset
property=jcr:content/metadata/dam:size
property.value = 42018

How to add operators to the predicate expression to generate below XPATH

//element(*, dam:Asset)
[
jcr:content/metadata/@dam:size<42018 
]

I need to search for assets with size less than 42018 Bytes