دعم الموقع

When I pull data for popular tv shows or movies, I get all the data, can get the Title, and release date to show up, but can't get the poster_path to show me anything. Any suggestions? I have the path correct, but no image

5 ردود (على هذه الصفحة 1 من 1)

Jump to last post

Hi Ryan,

I suggest taking a read through the following doc: https://developers.themoviedb.org/3/getting-started/images

That outlines how to generate valid image paths. While you're in there, I also suggest reading this doc as well.

Thanks Travis.

I have actually looked through all of this a bit already, and did again after you suggested. I have applied all of these tactics, but only the poster_path wont show from the data received. I'm using React, so the info is passed down through state and props.

<img src={`https://image.tmdb.org/t/p/w500/${this.props.image}`} />

this is the element I'm trying to use the poster_path on. The component calling on this sets the data as state, and then I parse that, and map the array of objects out to the smaller component and inner elements 'shown above'

this.props.image = poster_path

poster_path = /tQkigP2fItdzJWvtIhBvHxgs5yE.jpg

i wonder if this even makes sense to you... This is my first post ever, and I'm not the best at expressing my problems into words...

It looks like maybe you have 2 slashes.

https://image.tmdb.org/t/p/w500/tQkigP2fItdzJWvtIhBvHxgs5yE.jpg

Is a valid image, so perhaps this is what you're looking for:

<img src={`https://image.tmdb.org/t/p/w500${this.props.image}`} />

But you'll need to see what's generated by React as I am not familiar with whatever templating language that is.

You are correct about the 2 slashes. that was a typo here, but my actual code is like the snippet you wrote. Good call though.

So I have determined that the issue is that the code I'm writing in the img src for the external url isnt being compiled. not an issue from you guys. like I said before, the data is logging in the console, just not displaying the image.

When I inspect the image source with developer tools it shows me that the file path is my local url/poster_path instead of the external http address/poster_path... so there is an issue with my babel or webpack or something. very frustrating.

thanks for all your help!

Hey Ryan, I am facing the exact same problem. Can you tell how you got rid of the that issue?

While Inspecting using Developer tool I got the the required URL which was working just fine when ran on a new tab in chrome.

لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها

عام

s ركز شريط البحث
p افتح قائمة الملف الشخصي
esc اغلق النافذة المفتوحة
? افتح نافذة اختصارات لوحة المفاتيح

على كافة صفحات الوسائط

b ارجع للخلف (او للصفحة الام عند التطبيق)
e انتقل لصفحة التعديل

على كافة صفحات موسم المسلسل

(السهم الايمن) انتقل للموسم التالي
(السهم الايسر) انتقل للموسم السابق

على كافة صفحات حلقة المسلسل

(السهم الايمن) انتقل للحلقة التالية
(السهم الايسر) انتقل للحلقة السابقة

على كافة صفحات الصور

a افتح صفحة اضافة الصورة

على كافة صفحات التعديل

t افتح محدد الترجمة
ctrl+ s ارسال النموذج

على صفحات المناقشة

n انشى نقاش جديد
w تبديل حالة المتابعة
p تبديل عام / خاص
c تبديل اغلاق / فتح
a افتح الانشطة
r رد على النقاش
l انتقل لأخر رد
ctrl+ enter أرسل رسالتك
(السهم الايمن) الصفحة التالية
(السهم الايسر) الصفحة السابقة

الاعدادات

هل تريد تقييم او اضافة هذا العنصر للقائمة؟

تسجيل الدخول