mirror of
https://github.com/directus/directus.git
synced 2026-02-09 07:55:18 -05:00
Allow custom transformations of assets (#6593)
* Allow custom transformations of assets This exposes one query parameter `transforms`, which is a JSON array of shard transformation operations. It also updates the asset presets. The UX for this still needs some work * Rename options to arguments for presets More explicit * options -> arguments in setting spec * Better errors for invalid JSON in asset presets * Add limit to transforms query parameter * Use flattened option for extra transforms * Fix placeholder color of code input * Allow "simple mode" aliases * Add documentation Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
@@ -16,34 +16,11 @@ get:
|
||||
description: The key of the asset size configured in settings.
|
||||
schema:
|
||||
type: string
|
||||
- name: width
|
||||
- name: transforms
|
||||
in: query
|
||||
description: Width of the file in pixels.
|
||||
schema:
|
||||
type: integer
|
||||
- name: height
|
||||
in: query
|
||||
description: Height of the file in pixels.
|
||||
schema:
|
||||
type: integer
|
||||
- name: fit
|
||||
in: query
|
||||
description: Fit of the file
|
||||
description: A JSON array of image transformations
|
||||
schema:
|
||||
type: string
|
||||
enum: [crop, contain, inside, outside]
|
||||
- name: withoutEnlargement
|
||||
in: query
|
||||
description: No image upscale.
|
||||
schema:
|
||||
type: boolean
|
||||
- name: quality
|
||||
in: query
|
||||
description: Quality of compression.
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 100
|
||||
- name: download
|
||||
in: query
|
||||
description: Download the asset to your computer
|
||||
|
||||
Reference in New Issue
Block a user