Ask Your Question

Revision history [back]

How to tell the order of photos?

Hi Everyone,

I've got a little script that organizes property photos into a featured image (the primary image that appears in search listings) vs. gallery images (subsequent images that can be viewed upon visiting the property's detail page).

How should I distinguish which photo should be used as the featured/primary image? Right now, I am just putting the first photo returned into the featured spot, then all photos returned after that are put into the gallery. But I am not sure if that is correct, and could not find any documentation on this. My data provider isn't sure about this either.

I have a few hypothesis:

First I notice that photos have a Object-ID parameter, so I am curious if perhaps that is the better parameter to use when distinguishing primary vs. secondary images. (for example if the agent moves an image to the first spot, does the Object-ID then become 1?).

Second I also notice that there is a specific file naming convention when it comes to images, using the MLS number and an alphabetical suffix. For example for mls number 44332 the images would be named:

44332, 44332A, 44332B, 44332C

So I am wondering if the naming of the files has anything to do with the order.

Unfortunately there isn't much info available on this so I am only left with theories! Can anyone advise on this based on their experiences?