mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-11 07:22:33 +08:00
fix: ocr cluster
This commit is contained in:
@@ -4,9 +4,9 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"image"
|
"image"
|
||||||
"image/gif"
|
_ "image/gif"
|
||||||
"image/jpeg"
|
"image/jpeg"
|
||||||
"image/png"
|
_ "image/png"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"mime"
|
"mime"
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
@@ -256,10 +256,6 @@ func (dExt *DriverExt) saveScreenShot(raw *bytes.Buffer, fileName string) (strin
|
|||||||
case "jpeg", "png":
|
case "jpeg", "png":
|
||||||
jpegOptions := &jpeg.Options{Quality: 95}
|
jpegOptions := &jpeg.Options{Quality: 95}
|
||||||
err = jpeg.Encode(file, img, jpegOptions)
|
err = jpeg.Encode(file, img, jpegOptions)
|
||||||
case "png_import":
|
|
||||||
err = png.Encode(file, img)
|
|
||||||
case "gif_import":
|
|
||||||
err = gif.Encode(file, img, nil)
|
|
||||||
default:
|
default:
|
||||||
return "", fmt.Errorf("unsupported image format: %s", format)
|
return "", fmt.Errorf("unsupported image format: %s", format)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ func (s *veDEMImageService) GetImage(imageBuf *bytes.Buffer, options ...ActionOp
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 使用高精度集群
|
// 使用高精度集群
|
||||||
bodyWriter.WriteField("ocrCluster", "default_1600")
|
bodyWriter.WriteField("ocrCluster", "highPrecision")
|
||||||
|
|
||||||
if actionOptions.ScreenShotWithOCRCluster != "" {
|
if actionOptions.ScreenShotWithOCRCluster != "" {
|
||||||
bodyWriter.WriteField("ocrCluster", actionOptions.ScreenShotWithOCRCluster)
|
bodyWriter.WriteField("ocrCluster", actionOptions.ScreenShotWithOCRCluster)
|
||||||
|
|||||||
Reference in New Issue
Block a user