diff --git a/backend/app/routers/photos.py b/backend/app/routers/photos.py index 2ebbf89..46f074a 100644 --- a/backend/app/routers/photos.py +++ b/backend/app/routers/photos.py @@ -228,24 +228,162 @@ async def get_original( photo_id: str, db: AsyncSession = Depends(get_db) ): - """Serve original file for download""" + """Serve original file (download for RAW, inline for web-safe formats)""" result = await db.execute( select(Photo).where(Photo.id == photo_id) ) photo = result.scalar_one_or_none() - + if not photo: raise HTTPException(status_code=404, detail="Photo not found") - + if not os.path.exists(photo.filepath): raise HTTPException(status_code=404, detail="File not found") - + + # Pick a media type the browser can render inline for web-safe formats + # so the loupe view and