Skip to content

Commit a347125

Browse files
committed
fix: dnd support and image decoding
1 parent 940795b commit a347125

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pkg/commands/utils/interactive.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ func GetAppIDInteractive(cCtx *cli.Context, argIndex int, action string) (ethcom
294294
// Determine which apps are eligible for the action
295295
isEligible := func(status common.AppStatus, addr ethcommon.Address) bool {
296296
switch action {
297-
case "view":
297+
case "view", "set profile for":
298298
return true
299299
case "start":
300300
return status == common.ContractAppStatusStopped || status == common.ContractAppStatusSuspended || exitedApps[addr.Hex()]

pkg/commands/utils/profile_utils.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"fmt"
55
"html"
66
"image"
7+
_ "image/jpeg" // Register JPEG format decoder
8+
_ "image/png" // Register PNG format decoder
79
"net/url"
810
"os"
911
"path/filepath"
@@ -106,6 +108,9 @@ func ValidateAndGetImageInfo(filePath string) (*ImageInfo, error) {
106108
return nil, fmt.Errorf("image path cannot be empty")
107109
}
108110

111+
// Remove quotes that may be added by terminal drag-and-drop (e.g., '/path/to/file')
112+
filePath = strings.Trim(filePath, "'\"")
113+
109114
// Check if file exists
110115
info, err := os.Stat(filePath)
111116
if err != nil {

0 commit comments

Comments
 (0)