feat: generate images in desired size function added

This commit is contained in:
Sale Djenic 2022-04-06 13:08:52 +02:00 committed by saledjenic
parent 10d0133974
commit 4c993a8610
1 changed files with 14 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import (
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/exportlogs"
"github.com/status-im/status-go/extkeys"
"github.com/status-im/status-go/images"
"github.com/status-im/status-go/multiaccounts"
"github.com/status-im/status-go/multiaccounts/accounts"
"github.com/status-im/status-go/multiaccounts/settings"
@ -842,3 +843,16 @@ func SwitchFleet(fleet string, configJSON string) string {
return makeJSONResponse(err)
}
func GenerateImages(filepath string, aX, aY, bX, bY int) string {
iis, err := images.GenerateIdentityImages(filepath, aX, aY, bX, bY)
if err != nil {
return makeJSONResponse(err)
}
data, err := json.Marshal(iis)
if err != nil {
return makeJSONResponse(fmt.Errorf("Error marshalling to json: %v", err))
}
return string(data)
}