mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-24 20:36:24 +02:00
scaleup flag
This commit is contained in:
parent
f6e6a2cc86
commit
4e60c683b0
7 changed files with 57 additions and 15 deletions
12
transform.go
12
transform.go
|
|
@ -102,11 +102,13 @@ func transformImage(m image.Image, opt Options) image.Image {
|
|||
}
|
||||
|
||||
// never resize larger than the original image
|
||||
if w > imgW {
|
||||
w = imgW
|
||||
}
|
||||
if h > imgH {
|
||||
h = imgH
|
||||
if !opt.ScaleUp {
|
||||
if w > imgW {
|
||||
w = imgW
|
||||
}
|
||||
if h > imgH {
|
||||
h = imgH
|
||||
}
|
||||
}
|
||||
|
||||
// resize
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue