mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix image serving performance problem introduced in last release.
This commit is contained in:
parent
729716ab7a
commit
1c30a780a7
|
@ -125,7 +125,6 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
|
|||
}
|
||||
}
|
||||
if ext == ".png" || ext == ".jpg" || ext == ".gif" {
|
||||
if srcImage, _, err := image.Decode(bytes.NewReader(n.Data)); err == nil {
|
||||
width, height := 0, 0
|
||||
if r.FormValue("width") != "" {
|
||||
width, _ = strconv.Atoi(r.FormValue("width"))
|
||||
|
@ -134,6 +133,7 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
|
|||
height, _ = strconv.Atoi(r.FormValue("height"))
|
||||
}
|
||||
if width != 0 || height != 0 {
|
||||
if srcImage, _, err := image.Decode(bytes.NewReader(n.Data)); err == nil {
|
||||
bounds := srcImage.Bounds()
|
||||
var dstImage *image.NRGBA
|
||||
if width == height && bounds.Dx() != bounds.Dy() {
|
||||
|
|
Loading…
Reference in a new issue