feat(skincare): allow HEIC/HEIF uploads in skin analysis
This commit is contained in:
parent
f1acfa21fc
commit
d3bd2ff30d
2 changed files with 8 additions and 2 deletions
|
|
@ -140,7 +140,13 @@ async def analyze_skin_photos(
|
||||||
if not (1 <= len(photos) <= 3):
|
if not (1 <= len(photos) <= 3):
|
||||||
raise HTTPException(status_code=422, detail="Send between 1 and 3 photos.")
|
raise HTTPException(status_code=422, detail="Send between 1 and 3 photos.")
|
||||||
|
|
||||||
allowed = {"image/jpeg", "image/png", "image/webp"}
|
allowed = {
|
||||||
|
"image/heic",
|
||||||
|
"image/heif",
|
||||||
|
"image/jpeg",
|
||||||
|
"image/png",
|
||||||
|
"image/webp",
|
||||||
|
}
|
||||||
parts: list[genai_types.Part] = []
|
parts: list[genai_types.Part] = []
|
||||||
for photo in photos:
|
for photo in photos:
|
||||||
if photo.content_type not in allowed:
|
if photo.content_type not in allowed:
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@
|
||||||
</p>
|
</p>
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
accept="image/jpeg,image/png,image/webp"
|
accept="image/heic,image/heif,image/jpeg,image/png,image/webp"
|
||||||
multiple
|
multiple
|
||||||
onchange={handleFileSelect}
|
onchange={handleFileSelect}
|
||||||
class="block w-full text-sm text-muted-foreground
|
class="block w-full text-sm text-muted-foreground
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue