mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 07:26:55 +08:00
change: remove unused code
This commit is contained in:
@@ -2,6 +2,7 @@ package uixt
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"image"
|
||||
"image/color"
|
||||
@@ -221,6 +222,20 @@ func getScreenShotBuffer(driver IDriver) (compressedBufSource *bytes.Buffer, err
|
||||
return compressBufSource, nil
|
||||
}
|
||||
|
||||
// getScreenShotBufferBase64 takes a screenshot, returns the compressed image buffer in base64 format
|
||||
func getScreenShotBufferBase64(driver IDriver) (compressedBufBase64 string, err error) {
|
||||
compressBufSource, err := getScreenShotBuffer(driver)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
// convert buffer to base64 string
|
||||
screenShotBase64 := "data:image/jpeg;base64," +
|
||||
base64.StdEncoding.EncodeToString(compressBufSource.Bytes())
|
||||
|
||||
return screenShotBase64, nil
|
||||
}
|
||||
|
||||
// saveScreenShot saves compressed image file with file name
|
||||
func saveScreenShot(raw *bytes.Buffer, screenshotPath string) error {
|
||||
// notice: screenshot data is a stream, so we need to copy it to a new buffer
|
||||
|
||||
Reference in New Issue
Block a user