Skip to content

Commit

Permalink
Fix default width and height for photos
Browse files Browse the repository at this point in the history
  • Loading branch information
SmilyOrg committed May 10, 2024
1 parent d0f6735 commit f991565
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/layout/flex.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ func LayoutFlex(infos <-chan image.SourcedInfo, layout Layout, scene *render.Sce
}
}
}
if info.Width == 0 || info.Height == 0 {
info.Width = 3
info.Height = 2
}
photo := dag.Photo{
Id: info.Id,
AspectRatio: float32(info.Width) / float32(info.Height),
Expand Down
4 changes: 4 additions & 0 deletions internal/layout/highlights.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ func LayoutHighlights(infos <-chan image.InfoEmb, layout Layout, scene *render.S
prevEmb = emb
prevInvNorm = invnorm

if info.Width == 0 || info.Height == 0 {
info.Width = 3
info.Height = 2
}
photo := HighlightPhoto{
Photo: dag.Photo{
Id: info.Id,
Expand Down

0 comments on commit f991565

Please sign in to comment.