Adds support for tiny thumbnails
This commit is contained in:
parent
57a0163c04
commit
e703f69a48
2 changed files with 4 additions and 1 deletions
|
@ -783,10 +783,11 @@
|
||||||
{
|
{
|
||||||
"name": "size",
|
"name": "size",
|
||||||
"in": "query",
|
"in": "query",
|
||||||
"description": "The maximum size of the thumbnail, either small (400x400), large (1200x1200) or native",
|
"description": "The maximum size of the thumbnail: tiny (40x40), small (400x400), large (1200x1200) or native",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
"tiny",
|
||||||
"small",
|
"small",
|
||||||
"large",
|
"large",
|
||||||
"native"
|
"native"
|
||||||
|
|
|
@ -50,6 +50,7 @@ impl From<ThumbnailOptions> for thumbnail::Options {
|
||||||
#[derive(Clone, Copy, Serialize, Deserialize)]
|
#[derive(Clone, Copy, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum ThumbnailSize {
|
pub enum ThumbnailSize {
|
||||||
|
Tiny,
|
||||||
Small,
|
Small,
|
||||||
Large,
|
Large,
|
||||||
Native,
|
Native,
|
||||||
|
@ -59,6 +60,7 @@ pub enum ThumbnailSize {
|
||||||
impl Into<Option<u32>> for ThumbnailSize {
|
impl Into<Option<u32>> for ThumbnailSize {
|
||||||
fn into(self) -> Option<u32> {
|
fn into(self) -> Option<u32> {
|
||||||
match self {
|
match self {
|
||||||
|
Self::Tiny => Some(40),
|
||||||
Self::Small => Some(400),
|
Self::Small => Some(400),
|
||||||
Self::Large => Some(1200),
|
Self::Large => Some(1200),
|
||||||
Self::Native => None,
|
Self::Native => None,
|
||||||
|
|
Loading…
Add table
Reference in a new issue