From 5cb0869b94fc8b9aff564055af9a60046de7b028 Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Thu, 22 Oct 2020 22:09:46 -0400 Subject: Skipped separate photo table; working handler for get all products (lacking cats) --- dichroism/src/models/photo.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dichroism/src/models/photo.rs') diff --git a/dichroism/src/models/photo.rs b/dichroism/src/models/photo.rs index dee6288..6069085 100644 --- a/dichroism/src/models/photo.rs +++ b/dichroism/src/models/photo.rs @@ -11,6 +11,10 @@ pub struct Photo { } impl Photo { + pub fn from_path(path: String) -> Self { + Self { path } + } + pub fn from_image(image: &DynamicImage) -> Result { let base_name = Uuid::new_v3(&Uuid::NAMESPACE_OID, &image.to_bytes()) .to_hyphenated() -- cgit v1.2.3