Introduction
and Rewards.
File model
Definition
Key | Type | Description |
---|---|---|
url | URL | Link to the file |
width | integer | Image width |
height | integer | Image height |
kind | string | File kind identifier (e.x. offer_default ), see Standard file kinds |
size_type | string | e.x. base , see: File sizes |
File schema
Each file kind is also available in multiple sizes.
Example
{
"files_kinds": [
{
"identifier": "collection_cover_default",
"type": "IMAGE",
"ratio": "2:1",
"sizes": [
{
"identifier": "base",
"min_width": 600,
"min_height": 300,
"max_width": 600,
"max_height": 300
},
{
"identifier": "thumbnail",
"min_width": 300,
"min_height": 150,
"max_width": 300,
"max_height": 150
},
{
"identifier": "original",
"min_width": 600,
"min_height": 300,
"max_width": null,
"max_height": null
}
]
},
{
"identifier": "offer_default",
"type": "IMAGE",
"ratio": "3:4",
"sizes": [
{
"identifier": "base",
"min_width": 600,
"min_height": 800,
"max_width": 600,
"max_height": 800
},
{
"identifier": "thumbnail",
"min_width": 225,
"min_height": 300,
"max_width": 225,
"max_height": 300
},
{
"identifier": "original",
"min_width": 600,
"min_height": 800,
"max_width": null,
"max_height": null
}
]
},
{
"identifier": "reward_default",
"type": "IMAGE",
"ratio": "3:4",
"sizes": [
{
"identifier": "base",
"min_width": 600,
"min_height": 800,
"max_width": 600,
"max_height": 800
},
{
"identifier": "thumbnail",
"min_width": 225,
"min_height": 300,
"max_width": 225,
"max_height": 300
},
{
"identifier": "original",
"min_width": 600,
"min_height": 800,
"max_width": null,
"max_height": null
}
]
},
{
"identifier": "example_without_ratio",
"type": "IMAGE",
"ratio": null,
"sizes": [
{
"identifier": "base",
"min_width": 600,
"min_height": 600,
"max_width": null,
"max_height": null
},
{
"identifier": "thumbnail",
"min_width": null,
"min_height": null,
"max_width": 300,
"max_height": 300
},
{
"identifier": "original",
"min_width": 600,
"min_height": 600,
"max_width": null,
"max_height": null
}
]
}
]
}
File kind model
Key | Type | Description |
---|---|---|
identifier | string | See: Standard file kinds |
type | string | Currently, only IMAGE (MIME: image/gif , image/jpeg , image/png ) is supported |
ratio | string | Describes ratio of an image. See: Ratio (optional) |
sizes | Object[] | See: File sizes |
sizes[]['identifier'] | string | |
sizes[]['min_width'] | integer | (optional) |
sizes[]['min_height'] | integer | (optional) |
sizes[]['max_width'] | integer | (optional) |
sizes[]['max_height'] | integer | (optional) |
Standard file kinds
Identifier | Description |
---|---|
collection_cover_default | Cover for Offer collections |
offer_default | Default Offer image |
reward_default | Default Reward image |
Ratio
"<width>:<height>"
File sizes
base
min_*
== max_*
) that match the ratio.thumbnail
base
size. Currently, rescaling always works this way:300px
600x800
gets shrunk down to 225x300
800x600
gets shrunk down to 300x225
400x300
gets shrunk down to 300x225
400x200
gets shrunk down to 300x150
300x250
is not shrunk downoriginal
base
size.Because of that, you can expect them to have
min_height
and min_width
that match the base
size,but they never have
max_width
or max_height
defined.File cropping
crop_to
param interpretation may be visualized like this:
x_top_left x_bottom_right
|-------------------------------------
| ..........................
| ..........................
y_top_left | .....*---------------.....
| .....|..............|.....
| .....|..............|.....
| .....|..............|....
y_bottom_right | .....---------------*.....
| ..........................
|
This can be achieved by providing cropping param (
crop_to
).x_top_left,y_top_left,x_bottom_right,y_bottom_right
and represents boundaries of a cropping area.crop_to
param is not provided, the file will be automatically cropped with gravity set in center of image.Example
The file will be then also resized to 400x200.
Uploaded instances projections
base
and other versions are processed asynchronously.So, the responses returned on upload contains only "projected" info about files.
Key | Type | Description |
---|---|---|
size_type | string | |
url | string | An URL the file be available on after it gets processed. |
min_width | integer | |
max_width | integer | |
min_height | integer | |
max_height | integer |
Modified at 2024-04-22 22:18:12