🍿 @lorenzopant/tmdb

Images

Type definitions for image sizes and configuration used across the TMDB client.

These types are used to configure and work with images returned by the TMDB API. All image URLs are composed of a base URL, a size, and a file path.


ImagesConfig

Top-level image configuration passed to the constructor via the images option.

PropertyTypeDefaultDescription
secure_images_urlbooleantrueWhen true, uses the HTTPS base URL. Set to false only if HTTPS is unavailable in your environment.
default_image_sizesPartial<DefaultImageSizesConfig>Default sizes for each image category. Applied automatically when no size is specified at call time.

DefaultImageSizesConfig

Defines per-category default sizes. All properties are optional.

PropertyTypeDescription
postersPosterSizeDefault size for movie and TV show poster images.
backdropsBackdropSizeDefault size for backdrop/banner images.
logosLogoSizeDefault size for network, studio, and show logos.
profilesProfileSizeDefault size for cast and crew profile photos.
stillStillSizeDefault size for TV episode still images.

ImageSizeTypes

A convenience type that groups all image size types under a single object. Useful when you need to reference size types generically.

PropertyTypeDescription
BackdropSizeBackdropSizeSize options for backdrop images.
LogoSizeLogoSizeSize options for logo images.
PosterSizePosterSizeSize options for poster images.
ProfileSizeProfileSizeSize options for profile images.
StillSizeStillSizeSize options for still images.
ImageSizeImageSizeUnion of all available image sizes.

Size Types

BackdropSize

Used for movie and TV show backdrop (banner/hero) images.

type BackdropSize = "w300" | "w780" | "w1280" | "original";
ValueWidth
w300300px
w780780px
w12801280px
originalFull size

LogoSize

Used for production company, network, and streaming service logos.

type LogoSize = "w45" | "w92" | "w154" | "w185" | "w300" | "w500" | "original";
ValueWidth
w4545px
w9292px
w154154px
w185185px
w300300px
w500500px
originalFull size

PosterSize

Used for movie and TV show poster images.

type PosterSize = "w92" | "w154" | "w185" | "w342" | "w500" | "w780" | "original";
ValueWidth
w9292px
w154154px
w185185px
w342342px
w500500px
w780780px
originalFull size

ProfileSize

Used for cast and crew profile/headshot images.

type ProfileSize = "w45" | "w185" | "h632" | "original";
ValueDimension
w4545px wide
w185185px wide
h632632px tall
originalFull size

Note: h632 is height-constrained rather than width-constrained, unlike the other sizes.


StillSize

Used for TV episode still/screenshot images.

type StillSize = "w92" | "w185" | "w300" | "original";
ValueWidth
w9292px
w185185px
w300300px
originalFull size

ImageSize

A union of all available size values across every image type. Use this when you need to accept any valid size regardless of category.

type ImageSize = BackdropSize | LogoSize | PosterSize | ProfileSize | StillSize;

Base URLs

ConstantValue
IMAGE_BASE_URLhttp://image.tmdb.org/t/p/
IMAGE_SECURE_BASE_URLhttps://image.tmdb.org/t/p/

Image URLs are assembled as {base_url}{size}{file_path}, for example:

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

On this page