mirror of
https://github.com/agersant/polaris
synced 2024-11-14 03:17:06 +00:00
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",
|
||||
"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": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"tiny",
|
||||
"small",
|
||||
"large",
|
||||
"native"
|
||||
|
|
|
@ -50,6 +50,7 @@ impl From<ThumbnailOptions> for thumbnail::Options {
|
|||
#[derive(Clone, Copy, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum ThumbnailSize {
|
||||
Tiny,
|
||||
Small,
|
||||
Large,
|
||||
Native,
|
||||
|
@ -59,6 +60,7 @@ pub enum ThumbnailSize {
|
|||
impl Into<Option<u32>> for ThumbnailSize {
|
||||
fn into(self) -> Option<u32> {
|
||||
match self {
|
||||
Self::Tiny => Some(40),
|
||||
Self::Small => Some(400),
|
||||
Self::Large => Some(1200),
|
||||
Self::Native => None,
|
||||
|
|
Loading…
Reference in a new issue