mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-28 11:36:56 +08:00
change: simplify ocr texts summary
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v5.0.0+2412081145
|
v5.0.0+2412081202
|
||||||
|
|||||||
+8
-4
@@ -57,9 +57,12 @@ func (o OCRResults) ToOCRTexts() (ocrTexts OCRTexts) {
|
|||||||
Y: int(ocrResult.Points[2].Y),
|
Y: int(ocrResult.Points[2].Y),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
rectStr := fmt.Sprintf("%d,%d,%d,%d",
|
||||||
|
rect.Min.X, rect.Min.Y, rect.Max.X, rect.Max.Y)
|
||||||
ocrText := OCRText{
|
ocrText := OCRText{
|
||||||
Text: ocrResult.Text,
|
Text: ocrResult.Text,
|
||||||
Rect: rect,
|
Rect: rect,
|
||||||
|
RectStr: rectStr,
|
||||||
}
|
}
|
||||||
ocrTexts = append(ocrTexts, ocrText)
|
ocrTexts = append(ocrTexts, ocrText)
|
||||||
}
|
}
|
||||||
@@ -67,8 +70,9 @@ func (o OCRResults) ToOCRTexts() (ocrTexts OCRTexts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type OCRText struct {
|
type OCRText struct {
|
||||||
Text string
|
Text string `json:"text"`
|
||||||
Rect image.Rectangle
|
RectStr string `json:"rect"`
|
||||||
|
Rect image.Rectangle `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t OCRText) Size() Size {
|
func (t OCRText) Size() Size {
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ type DriverResult struct {
|
|||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
ResponseStatus int `json:"response_status"`
|
ResponseStatus int `json:"response_status"`
|
||||||
ResponseDuration int64 `json:"response_duration(ms)"` // ms
|
ResponseDuration int64 `json:"response_duration(ms)"` // ms
|
||||||
ResponseBody string `json:"response_body,omitempty"`
|
ResponseBody string `json:"response_body"`
|
||||||
Error string `json:"error,omitempty"`
|
Error string `json:"error,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user