Generate a thumbnail.
(data: ThumbnailRequest)
| 217 | |
| 218 | @app.post("/api/image/thumbnail") |
| 219 | async def generate_thumbnail(data: ThumbnailRequest): |
| 220 | """Generate a thumbnail.""" |
| 221 | try: |
| 222 | client = await get_dirty_client_async() |
| 223 | result = await client.execute_async( |
| 224 | IMAGE_WORKER, |
| 225 | "generate_thumbnail", |
| 226 | image_data=data.image_data, |
| 227 | size=data.size, |
| 228 | ) |
| 229 | return result |
| 230 | except DirtyError as e: |
| 231 | raise HTTPException(status_code=500, detail=str(e)) |
| 232 | |
| 233 | |
| 234 | @app.post("/api/image/process-batch") |
nothing calls this directly
no test coverage detected