Render curated date-folder photos with title date and place captions
This commit is contained in:
@@ -18,6 +18,7 @@ from pigway_frame_flow.models import (
|
||||
)
|
||||
from pigway_frame_flow.providers.photo_sources import PhotoSources
|
||||
from pigway_frame_flow.renderers.images import convert
|
||||
from pigway_frame_flow.renderers.photo_caption import render_captioned_photo
|
||||
from pigway_frame_flow.storage.database import encode, now_iso
|
||||
|
||||
|
||||
@@ -173,8 +174,17 @@ class DisplayService:
|
||||
)
|
||||
return asset
|
||||
if isinstance(content, PhotoSourceContent):
|
||||
data, name = self.photo_sources.read(content.source_id, content.item_id)
|
||||
return self.assets.put(convert(data, content.fit, content.profile), name)
|
||||
data, name, caption = self.photo_sources.read(
|
||||
content.source_id, content.item_id
|
||||
)
|
||||
rendered = (
|
||||
render_captioned_photo(
|
||||
data, caption, self.renderer.font, content.fit, content.profile
|
||||
)
|
||||
if caption
|
||||
else convert(data, content.fit, content.profile)
|
||||
)
|
||||
return self.assets.put(rendered, name)
|
||||
if isinstance(content, URLContent):
|
||||
data = self.assets.fetch_url(content.url)
|
||||
elif isinstance(content, ImageContent) and content.asset_id:
|
||||
|
||||
Reference in New Issue
Block a user