Skip to content

Commit

Permalink
fix: set default size if no size is set for api options
Browse files Browse the repository at this point in the history
  • Loading branch information
theredrad committed Sep 25, 2021
1 parent e942f5d commit f71a858
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@ func New(manager *manager.Manager, imageProcessor image.Processor, options *Opti
MaxWidth: maxSize,
MaxHeight: maxSize,
}
} else {
if options.MinWidth == 0 {
options.MinWidth = minSize
}

if options.MinHeight == 0 {
options.MinHeight = minSize
}

if options.MaxWidth == 0 {
options.MaxWidth = maxSize
}

if options.MaxHeight == 0 {
options.MaxHeight = maxSize
}
}

return &API{
Expand Down

0 comments on commit f71a858

Please sign in to comment.