Keyboard Shortcuts
Advanced Search
Hey i was wondering how to use the poster_path image file from the api? Please help!
Hi @olbu,
Take a read through the image documentation. If you have any specific questions let me know.
Hey, thanks for the answer! Could you help me with using this link but with a variable?
https://image.tmdb.org/t/p/w500/kqjL17yufvn9OVLyXYpvtyrFfak.jpg
So i want to use the api and get that last "/kqjL17yufvn9OVLyXYpvtyrFfak.jpg" from poster_path api and then send it to my something like
"img src="https://image.tmdb.org/t/p/w500 + poster_pathVar"
I'm sorry if this is confusing as hell, I don't have my code atm so I tried to remember what I last wrote. Thanks!!
@olbu That sounds like a coding question. And it sounds like you need to find the part before the last forward slash and use that as your prefix.
E.g. To get prefix and suffix from the image URL in JS:
const url = "https://image.tmdb.org/t/p/w500/kqjL17yufvn9OVLyXYpvtyrFfak.jpg" const prefix = url.substr(0, url.lastIndexOf('/') + 1) const suffix = url.substr(url.lastIndexOf('/') + 1) console.log(prefix) console.log(suffix)
https://codepen.io/kJamesy/pen/zQPGOP
Can't find a movie or TV show? Login to create it.
Login
Sign Up
Want to rate or add this item to a list?
Not a member?
Sign up and join the community
Reply by Travis Bell
on May 16, 2019 at 10:18 AM
Hi @olbu,
Take a read through the image documentation. If you have any specific questions let me know.
Reply by olbu
on May 16, 2019 at 1:17 PM
Hey, thanks for the answer! Could you help me with using this link but with a variable?
So i want to use the api and get that last "/kqjL17yufvn9OVLyXYpvtyrFfak.jpg" from poster_path api and then send it to my something like
I'm sorry if this is confusing as hell, I don't have my code atm so I tried to remember what I last wrote. Thanks!!
Reply by kjamesy
on May 21, 2019 at 6:59 AM
@olbu That sounds like a coding question. And it sounds like you need to find the part before the last forward slash and use that as your prefix.
E.g. To get prefix and suffix from the image URL in JS:
https://codepen.io/kJamesy/pen/zQPGOP