500px / legacy-api-documentation

This is the 500px API documentation.
22 stars 9 forks source link

Get Galleries - Cover or Thumbnail Photo #173

Open mattjiggins opened 8 years ago

mattjiggins commented 8 years ago

Hi,

The value being returned for cover_photo or thumbnail_photo for Portfolio gallery kinds seems to be "randomly" generated. The collection api would return the lead image (first) from the photo manager, which is exactly how it should be.

Is there a way to set a specific photo in a portfolio as the cover_image or lead_image?

Or is it possible to simply return the galleries object with the proper photo based on the sort as in the manager?

thanks!

cdmicacc commented 8 years ago

The old sets/portfolios system didn't actually have the concept of a cover photo -- the thumbnail was just the first image added, as you mentioned.

However, the new Galleries (which includes portfolios) do support an explicit cover photo, which can be changed by using the gallery update API.

mattjiggins commented 8 years ago

Hey @cdmicacc thanks for the reply!

Indeed, I'm now using Galleries instead of / as well as portfolios.

But I thought it would be a good idea to have the portfolio that's returned use the same logic as collections did/does - ie use the first photo in the portfolio (as it is manually set / dragged) as the "cover" or "thumbnail", rather than using the first uploaded image. (ie the one photo that is returned with a gallery call)

Perhaps it comes down to a conflict between what's a portfolio (set of images) vs what's a gallery?

-matt


As background: I'm building a personal photo site using node and just trying to reduce calls and complexity. The idea is using 500px for organizing, community, sales etc, but having ultimate control over a personal site. (The Portfolio website option is ok but i just need a little more control. It'd be great if i could upload my own theme btw).

cdmicacc commented 8 years ago

Hmm. The "thumbnail" returned by the old collections APIs should be the same as the cover returned by the gallery APIs (when you say include_cover=1) -- the old APIs are currently just translating galleries into the legacy formats, so there isn't a separate bit of logic happening here (or, there shouldn't be).

Maybe this is a bug in the API -- can you provide me with a gallery ID that returns a different cover/thumbnail in the old collections API than in the new galleries API?

mattjiggins commented 8 years ago

Hi @cdmicacc ,

Just to confirm, my "galleries" are all working fine. It's simply the Portfolio's that have this weird issue.

Here's one of the problem portfolio's:

Portfolio: 21189015 ( Paris: Couleur )

Using Collections: "photos" first record is photo id: 133087077

Using Galleries: "thumbnail_photos" and "cover_photo" first record (and only) is photo id: 133087081

This photo, is actually now 3rd in the order (manually set) via the /manage/portfolios/ page.

-matt

cdmicacc commented 8 years ago

Ah, I think I see what you mean. This is a change in behaviour -- galleries have a fixed cover photo. It defaults to the first photo added but doesn't changed automatically after that (unless the added photo is later removed). Because portfolios are just galleries now, this behaviour applies to them, too.