Adds support for tiny thumbnails

This commit is contained in:
Antoine Gersant 2024-08-25 20:05:27 -07:00
parent 57a0163c04
commit e703f69a48
2 changed files with 4 additions and 1 deletions

View file

@ -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"

View file

@ -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,