Skip to content

image_storage

Handles storing images (local or remote file storage).

LocalImageStorage

LocalImageStorage(base_folder: str)

add_recipe_image

add_recipe_image(recipe_id: UUID, image: bytes, filename: str, image_id: UUID) -> UUID

Save image to local filesystem using predictable path {image_id}{ext}.

delete_image

delete_image(image_id: UUID) -> bool

Delete an image file from local storage by image ID.

get_recipe_image

get_recipe_image(image_id: UUID) -> ImageResponse | None

Retrieve image bytes from storage by image ID.