Legacy Version

These are the docs for Directus 8, a legacy version of the platform. If you're looking for the current Directus 9 documentation, go here: https://docs.directus.io

Assets (Thumbnails)

Image typed files can be dynamically resized and transformed to fit any need.


Get an asset

Get a resized file. Files are resized on demand.

Parameters

project required

The project you're targetting.

key required

private_hash of the file.

Query

key optional

The key of the asset size configured in settings.

w optional

Width of the file in pixels.

h optional

Height of the file in pixels.

f optional

Fit. One of crop, contain.

q optional

Quality of compression. Number between 1 and 100.

If you're using key, you don't need to specify any of the other query parameters. If you're using w, h, or any of the others, you're required to provide them all. This allows Directus to match it against the whitelist in settings. If you have the whitelist turned off completely, any combination is allowed.

Endpoint
   GET /:project/assets/:key