czk 4 年之前
父节点
当前提交
d52f5bef25
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      http/handle.go

+ 5 - 4
http/handle.go

@@ -3,6 +3,7 @@ package http
 import (
 	"bytes"
 	json2 "encoding/json"
+	"image"
 	"io/ioutil"
 	"net/http"
 	"strings"
@@ -65,10 +66,10 @@ func parseForm(req *http.Request, v interface{}) error {
 			if err != nil {
 				return err
 			}
-			//if img, _, err := image.Decode(f); err == nil {
-			//	value[k1+"Height"] = img.Bounds().Max.Y
-			//	value[k1+"Wide"] = img.Bounds().Max.X
-			//}
+			if img, _, err := image.Decode(f); err == nil {
+				value[k1+"Height"] = img.Bounds().Max.Y
+				value[k1+"Wide"] = img.Bounds().Max.X
+			}
 			value[k1] = buf.Bytes()
 			value[k1+"Filename"] = v1[0].Filename
 		}