Skip to content

Commit ec665f7

Browse files
committed
✨ | Added "format" option
1 parent 5859b94 commit ec665f7

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

modes/display.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/go-vgo/robotgo"
99
)
1010

11-
func Display(save string, clipboard, output, upload bool, display int) {
11+
func Display(save, format string, clipboard, output, upload bool, display int) {
1212
var screenshot image.Image
1313

1414
displays := utils.GetDisplays()
@@ -20,7 +20,7 @@ func Display(save string, clipboard, output, upload bool, display int) {
2020

2121
displaySelected := displays[display]
2222

23-
screenshot = robotgo.CaptureImg(
23+
screenshot = robotgo.CaptureImg (
2424
displaySelected.X,
2525
displaySelected.Y,
2626
displaySelected.Width,
@@ -40,12 +40,12 @@ func Display(save string, clipboard, output, upload bool, display int) {
4040
}
4141

4242
if output {
43-
utils.OutputToStdout(screenshot)
43+
utils.OutputToStdout(screenshot, format)
4444

4545
}
4646

4747
if upload {
48-
utils.UploadImage(screenshot)
48+
utils.UploadImage(screenshot, format)
4949

5050
}
5151
}

modes/fullscreen.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"github.com/z3oxs/ghost/utils"
66
)
77

8-
func Fullscreen(save string, clipboard, output, upload bool) {
8+
func Fullscreen(save, format string, clipboard, output, upload bool) {
99
screenshot := robotgo.CaptureImg()
1010

1111
utils.PlaySound("/opt/ghost/screenshot.wav")
@@ -21,12 +21,12 @@ func Fullscreen(save string, clipboard, output, upload bool) {
2121
}
2222

2323
if output {
24-
utils.OutputToStdout(screenshot)
24+
utils.OutputToStdout(screenshot, format)
2525

2626
}
2727

2828
if upload {
29-
utils.UploadImage(screenshot)
29+
utils.UploadImage(screenshot, format)
3030

3131
}
3232
}

modes/selection.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/z3oxs/ghost/utils"
88
)
99

10-
func Selection(save string, clipboard, output, upload bool) {
10+
func Selection(save, format string, clipboard, output, upload bool) {
1111
var x1, x2, y1, y2 int
1212
var screenshot image.Image
1313

@@ -46,12 +46,12 @@ func Selection(save string, clipboard, output, upload bool) {
4646
}
4747

4848
if output {
49-
utils.OutputToStdout(screenshot)
49+
utils.OutputToStdout(screenshot, format)
5050

5151
}
5252

5353
if upload {
54-
utils.UploadImage(screenshot)
54+
utils.UploadImage(screenshot, format)
5555

5656
}
5757
}

0 commit comments

Comments
 (0)