Merge pull request #2217 from combineads/add_webp_format

This commit is contained in:
Chris Lu
2021-07-24 09:42:41 -07:00
committed by GitHub
4 changed files with 29 additions and 1 deletions

View File

@@ -264,7 +264,7 @@ func conditionallyResizeImages(originalDataReaderSeeker io.ReadSeeker, ext strin
}
func shouldResizeImages(ext string, r *http.Request) (width, height int, mode string, shouldResize bool) {
if ext == ".png" || ext == ".jpg" || ext == ".jpeg" || ext == ".gif" {
if ext == ".png" || ext == ".jpg" || ext == ".jpeg" || ext == ".gif" || ext == ".webp" {
if r.FormValue("width") != "" {
width, _ = strconv.Atoi(r.FormValue("width"))
}