Commit graph

3 commits

Author SHA1 Message Date
b859fece88
Introduce image request query parameter for filtering and selection (#2)
* Add selection ability using image query parameter

the selections is the index of the list of images,
where 0 is the first image. `os.listdir` is asumed
to always sort the list the same.

- if no selection is provided, take random image
  from image collection (like main)
- if 1 selection is provided, return the nth image
  from collection
- if 2 or more selections are provided, take random
  item from the selection and return the image at
  that index.

* Handle bad selection input

- Nondigit selections returns HTTP 401
- exclude indexes out of range (0--collection length)
2024-09-15 20:46:02 +02:00
ee699df9e6
Improve image rendering (#1)
* Re-randomize image if dimensions do not satisfy

* Try a maximum of 10 times to generate an image

* Decrease image generation cache to 1s

* Increase image quality
2024-09-09 09:12:44 +02:00
5152af4126 Create placeany flask project 2024-09-03 00:52:43 +02:00