Suport de The Movie Database

Are the images sizes not guaranteed (or at least supposed to be) to be the same width and height? I'm using a recycler view in my android application, with the images set to automatically scale themselves to the original aspect ratio, when images take up half the screen.

This has been working really well, up until I added Westworld. This image isn't the same aspect ratio as the rest (I'm using the 780 images) so it isn't displaying in a uniform manner.

Screenshots: https://goo.gl/photos/Vg9KPQMUq7UXmMXt5

Is this an anomaly, or are the items not actually fixed sizes?

7 resposta (a les p脿gines 1 de 1)

Jump to last post

Yes, the current top poster has an "incorrect" aspect ratio: https://www.themoviedb.org/tv/63247-westworld/images/posters

I"ll fix it! But there are bound to be more entries like that I'm afraid.

Is there a way via the API to validate that the image I'm grabbing is the appropriate aspect ratio? I noticed that the link you sent actually shows the sizes and indicates the top poster is not in the correct aspect ratio. I'll look at the API again, but I don't think I saw that information available. These little things drive me crazy enough that making another call to grab a different poster would be worth the network overhead to me, especially since I'm caching everything!

I thought something like this might work, but it doesn't appear to actually return anything:

https://api.themoviedb.org/3/tv/1421/images?api_key=&language=en-US

There is no explicit ratio information supplied on the API. The size information is however supplied in the response, so you can figure it out locally. We try to enforce as close to a 1:1.5 ratio for posters as possible.

I'm probably being obtuse at this point, but are you saying the API response itself has a size component? The image lookup API doesn't seem to return anything. For example, https://api.themoviedb.org/3/tv/63247/images?api_key=&language=en-US is returning the follow for me. Is there something in the API I'm missing (I'm definitely the type to search for the glasses on my head if you know what I mean). Obviously I can compute the size after actually getting the image, but I don't see a way to get the alternate posters.

{
     backdrops: [ ],
     id: 63247,
     posters: [ ]
}

That's because there's no images added with the language you are specifying. Make sure to read through this help article.

https://api.themoviedb.org/3/tv/63247/images?api_key=&language=en-US&include_image_language=en,null

Which will return a response like so:

{
  "backdrops": [
    {
      "aspect_ratio": 1.77777777777778,
      "file_path": "/6ROakWtfAXIZCFzBsBE4Cr70urA.jpg",
      "height": 1485,
      "iso_639_1": null,
      "vote_average": 5.442,
      "vote_count": 7,
      "width": 2640
    },
    {
      "aspect_ratio": 1.77777777777778,
      "file_path": "/8GABbITnzhGuE2RAfWWK0BVdbNo.jpg",
      "height": 2160,
      "iso_639_1": null,
      "vote_average": 5.326,
      "vote_count": 7,
      "width": 3840
    },
    {
      "aspect_ratio": 1.77777777777778,
      "file_path": "/45rk1PQjiTvEPzi0yBfYl0bdzz3.jpg",
      "height": 1620,
      "iso_639_1": null,
      "vote_average": 5.306,
      "vote_count": 7,
      "width": 2880
    },
    ...
  ]
}

And you'll actually see, I was wrong (I completely forgot about this) there is an aspect ratio field.

Sheesh. Right in front of my nose! Thank you for helping!

No problem!

No trobeu una pel路l铆cula o una s猫rie? Inicieu la sessi贸 per a crear-la.

Global

s centra la barra de cerca
p obre el men煤 del perfil
esc tanca una finestra oberta
? obre la finestra de dreceres de teclat

A les p脿gines de materials

b torna enrere (o la superior quan sigui aplicable)
e ves a la p脿gina d鈥檈dici贸

A les p脿gines de temporades

(fletxa dreta) ves a la temporada seg眉ent
(fletxa esquerra) ves a la temporada anterior

A les p脿gines d'episodis

(fletxa dreta) ves a l'episodi seg眉ent
(fletxa esquerra) ves a l'episodi anterior

A totes les p脿gines d'imatges

a obre la finestra d'afegir imatges

A totes les p脿gines d'edici贸

t obre el selector de traducci贸
ctrl+ s envia el formulari

A les p脿gines de debat

n crea un debat nou
w canvia l'estat de visualitzaci贸
p canvia p煤blic/privat
c tanca o obre
a obre activitat
r resposta al debat
l ves a la darrera resposta
ctrl+ enter envieu el vostre missatge
(fletxa dreta) p脿gina seg眉ent
(fletxa esquerra) p脿gina anterior

Configuracions

Desitgeu valorar o afegir aquest element a una llista?

Inicieu la sessi贸