Ask Your Question

How to tell the order of photos?

asked 2016-01-06 17:48:44 -0600

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-01-06 18:38:41 -0600

For paragon RETS sites, ObjectID=0 or ObjectID=1 will always return the primary or first photo. If the agent moves the photo to the first slot it becomes ObjectID=1. ObjectID=2 and up are secondary photos.

You can use whatever naming convention you want to store them locally. Typically it would use the (listingid+sequence identifier) of some kind. You could use something like 44332_001, 44332_002, etc for example. Or a two digit sequence. If you zero fill, it would group the photos for a listing in order properly.

edit flag offensive delete link more


Thanks, that helps me write the logic of my script. ObjectID it is!

dboi gravatar imagedboi ( 2016-01-07 01:02:41 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-01-06 17:48:44 -0600

Seen: 2,330 times

Last updated: Jan 06 '16