Scale images to fit or fill
This commit is contained in:
@@ -18,10 +18,10 @@ func MaybePreprocessImage(filename string, data []byte, width, height int) (resi
|
||||
ext = strings.ToLower(ext)
|
||||
switch ext {
|
||||
case ".png", ".gif", ".webp":
|
||||
return Resized(ext, data, width, height)
|
||||
return Resized(ext, data, width, height, "")
|
||||
case ".jpg", ".jpeg":
|
||||
data = FixJpgOrientation(data)
|
||||
return Resized(ext, data, width, height)
|
||||
return Resized(ext, data, width, height, "")
|
||||
}
|
||||
return data, 0, 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user