From a646b6258e3265c218caa397638cc455da1844e7 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期三, 15 一月 2020 12:26:18 +0800
Subject: [PATCH] debug

---
 goface.go |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/goface.go b/goface.go
index 938ff51..bfe5475 100644
--- a/goface.go
+++ b/goface.go
@@ -150,9 +150,13 @@
 	if !s.extractor {
 		return nil
 	}
+	s.printLog("->face--> facepos: ", fpos)
 
 	var featLen C.int
 	pos := (*C.cFacePos)(unsafe.Pointer(&fpos))
+	if pos == nil {
+		return nil
+	}
 
 	p := C.c_api_face_extract(&featLen, pos, (*C.uchar)(unsafe.Pointer(&data[0])), C.int(w), C.int(h), C.int(ch))
 	if p != nil {
@@ -175,15 +179,15 @@
 }
 
 // Propertize prop
-func (s *SDKFace) Propertize(fpos sdkstruct.CFacePos, data []byte, w, h, c int, ch int) *sdkstruct.CThftResult {
+func (s *SDKFace) Propertize(fpos sdkstruct.CFacePos, data []byte, w, h, c int, ch int) sdkstruct.CThftResult {
 	if !s.propertizer {
-		return nil
+		return sdkstruct.CThftResult{Age: 0}
 	}
 
 	pos := (*C.cFacePos)(unsafe.Pointer(&fpos))
 	result := C.c_api_face_property(pos, (*C.uchar)(unsafe.Pointer(&data[0])), C.int(w), C.int(h), C.int(ch))
 	s.printLog("->face--> Propertize")
-	return (*sdkstruct.CThftResult)(unsafe.Pointer(&result))
+	return *(*sdkstruct.CThftResult)(unsafe.Pointer(&result))
 }
 
 // CFaceInfoArrayToGoArray convert cFaceInfo array to go

--
Gitblit v1.8.0