---
panlei
2019-07-02 0c8dffc024fc2f8f6b185a2b85387309e4e62aca
insertdata/insertDataToEs.go
@@ -98,9 +98,9 @@
func InsertToEs(msg ruleserver.ResultMsg) {
   // 直接从规则的标签数据里拿符合规则的人脸结果
   if msg.RuleResult["faces"] != nil && len(msg.RuleResult["faces"].([]ruleserver.Arg)) > 0 {
   if msg.RuleResult["face"] != nil && len(msg.RuleResult["face"].([]ruleserver.Arg)) > 0 {
      log.Println("往ES插人脸数据")
      for _, face := range msg.RuleResult["faces"].([]ruleserver.Arg) {
      for _, face := range msg.RuleResult["face"].([]ruleserver.Arg) {
         // 上传大图
         // 解压缩并上传图片
         bdata, err := util.UnCompress(msg.Data)
@@ -126,9 +126,9 @@
            }
            i := protomsg.Image{}
            err = proto.Unmarshal(bdata, &i)
            i1 := protomsg.Image{}
            i1 = util.Subimg(i.Data, int(face.Location.X), int(face.Location.Y), int(face.Location.X+face.Location.Width), int(face.Location.Y+face.Location.Height))
            resp, err := util.PostFormBufferData(weedfsUrl, i1, uuid.NewV4().String())
            log.Println("======================================看看这个框:",face.Location)
            bytes := util.Subimg(i.Data, int(face.Location.X), int(face.Location.Y), int(face.Location.X+face.Location.Width), int(face.Location.Y+face.Location.Height))
            resp, err := util.PostFormBufferData1(weedfsUrl, bytes, uuid.NewV4().String())
            if err != nil {
               log.Println("上传小图出错")
            }