mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-18 17:29:23 +08:00
filer: skip resizing image if width or height larger than original image
fix https://github.com/chrislusf/seaweedfs/issues/1239#issuecomment-602140779
This commit is contained in:
@@ -6,10 +6,11 @@ import (
|
||||
"image/gif"
|
||||
"image/jpeg"
|
||||
"image/png"
|
||||
"io"
|
||||
|
||||
"github.com/disintegration/imaging"
|
||||
|
||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||
"github.com/disintegration/imaging"
|
||||
"io"
|
||||
)
|
||||
|
||||
func Resized(ext string, read io.ReadSeeker, width, height int, mode string) (resized io.ReadSeeker, w int, h int) {
|
||||
@@ -35,6 +36,7 @@ func Resized(ext string, read io.ReadSeeker, width, height int, mode string) (re
|
||||
}
|
||||
}
|
||||
} else {
|
||||
read.Seek(0, 0)
|
||||
return read, bounds.Dx(), bounds.Dy()
|
||||
}
|
||||
var buf bytes.Buffer
|
||||
|
Reference in New Issue
Block a user