[chore] add some more slice related utility functions + remove duplicated functions (#3149)

This commit is contained in:
kim 2024-07-30 09:29:32 +00:00 committed by GitHub
commit 47c26818d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 216 additions and 43 deletions

View file

@ -218,8 +218,13 @@ func (p *ProcessingMedia) store(ctx context.Context) error {
}
if width > 0 && height > 0 {
// Determine thumbnail dimensions to use.
thumbWidth, thumbHeight := thumbSize(width, height, aspect, result.rotation)
// Determine thumbnail dimens to use.
thumbWidth, thumbHeight := thumbSize(
width,
height,
aspect,
result.rotation,
)
p.media.FileMeta.Small.Width = thumbWidth
p.media.FileMeta.Small.Height = thumbHeight
p.media.FileMeta.Small.Size = (thumbWidth * thumbHeight)