Asset listing based on image width?


(Tim Trodd) #1

Matrix Version: 5.4.3.0

Hi,

I was just wondering if it was possible to have an asset listing based on image size? e.g. show all images that have a width of 300pixels.

Reason for this is we are changing a our standard image dimensions and want to find any images that are the old width that are still lurking around.

I think we can do it using ssjs by printing a whole list and filtering by image width but just wondered if there was a quicker way?

Cheers,

Tim


(Bart Banda) #2

You could do it in two ways:

  1. Asset list all images and use conditional keywords or SSJS to show/hide images based on the width.
  2. Add a new metadata text field with a default value of the keyword for the width, probably with a keyword modifier that does something like, if image width is 300px or smaller, print “small_image”, then do a stored search on images targeting that metadata field and value.

Option 1 is easier though.


(Tim Trodd) #3

Thanks I have implemented it using ssjs!