vova616 / screenshot Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I am getting the following exception while taking a screenshot on Ubuntu.
XGB: conn.go:47: Could not get authority info: open /var/go/.Xauthority: no such file or directory
XGB: conn.go:48: Trying connection without authority info...
XGB: conn.go:47: Could not get authority info: open /var/go/.Xauthority: no such file or directory
XGB: conn.go:48: Trying connection without authority info...
panic: runtime error: index out of range
goroutine 1 [running]:
panic(0x556a40, 0xc420014130)
/usr/local/Cellar/go/1.7.4/libexec/src/runtime/panic.go:500 +0x1a1
image.(*RGBA).Opaque(0xc42065c000, 0x62e340)
/usr/local/Cellar/go/1.7.4/libexec/src/image/image.go:141 +0xc3
image/png.opaque(0x62e340, 0xc42065c000, 0x62c240)
/usr/local/Cellar/go/1.7.4/libexec/src/image/png/writer.go:60 +0x162
image/png.(*Encoder).Encode(0xc4200e6010, 0x62c5c0, 0xc420054000, 0x62e340, 0xc42065c000, 0x0, 0x0)
/usr/local/Cellar/go/1.7.4/libexec/src/image/png/writer.go:508 +0x505
image/png.Encode(0x62c5c0, 0xc420054000, 0x62e340, 0xc42065c000, 0x0, 0x0)
/usr/local/Cellar/go/1.7.4/libexec/src/image/png/writer.go:476 +0x6a
main.main()
/Users/kashishm/Documents/go/src/github.com/sample/example/main.go:42 +0x155
code(from example folder)
func main() {
img, err := screenshot.CaptureScreen()
if err != nil {
panic(err)
}
f, err := os.Create("./ss.png")
if err != nil {
panic(err)
}
err = png.Encode(f, img)
if err != nil {
panic(err)
}
f.Close()
}
Receive the following:
ERROR x protocol authentication refused: Maximum number of clients reached
continuously from
img, err := screenshot.CaptureScreen()
after running for several hundred iterations.
I have a feeling this is an upstream error as your code seems to close the xgb handle that you create.
I'll try and make a minimal testcase.
If I suppose I have a window descriptor for the application I need, how can I do this?
for {
screenshot.CaptureScreen()
}
I attempted to use this library on my Windows 8.1 laptop and, first, had to change these lines to use uint32, int32 and int32, respectively, in order to get the code to compile.
After that, using https://github.com/AllenDang/w32 caused some runtime fatal errors. I went and found a more up-to-date branch, and found that the fork https://github.com/fromkeith/w32 fixed the fatal errors I was having.
Anyway, this isn't really an issue, but I figured I'd let the author of this library know.
Screenshot (using example program) works fine with I have scaling at 100%. But if I change scaling (say 125% or 150%), screenshot doesn't capture entire screen
After taking a lot of screenshots on Linux, I get the following error:
x protocol authentication refused: Maximum number of clients reachedError
Am I supposed to call something after I take a screenshot.
I also get those logs whenever I take a screenshot:
XGB: conn.go:47: Could not get authority info: EOF
XGB: conn.go:48: Trying connection without authority info...
I couldn't find a way to make this work on mac without using cgo, I will keep searching but the current way is not working at all.
what kind of fps can I expect on a relatively decent mac?
github.com/vova616/screenshot/screenshot_darwin.go:49: cannot use rawData (type C.CFDataRef) as type C.CFTypeRef in argument to func literal
This is the error that is returned:
BadMatch {NiceName: Match, Sequence: 1, BadValue: 569, MinorOpcode: 0, MajorOpcode: 73}
I could imagine that it simply will not work on Wayland but in that case the error message is confusing.
For example: I have screen 1 and screen 2, how can I take a screenshot of 1 or 2?
I have experienced a panic in BitBlt. This is hardly necessary to trigger panics in your package, when you could just return an error.
panic: BitBlt failed
goroutine 12 [running]:
myproject/vendor/github.com/vova616/screenshot.BitBlt(0xffffffff920134ee, 0x0, 0x0, 0x31c, 0x4c, 0xffffffff90011059, 0xbe4, 0x824, 0xcc0020)
myproject/vendor/github.com/vova616/screenshot/screenshot_windows.go:140 +0xed
myproject/vendor/github.com/vova616/screenshot.CaptureRect(0xbe4, 0x824, 0xf00, 0x870, 0x0, 0x0, 0x0)
myproject/sectionGuard/vendor/github.com/vova616/screenshot/screenshot_windows.go:74 +0x310
main.GetTraybarBackground(0xc04224cf50, 0xc04234b301, 0x0, 0x0)
myproject/main.go:30 +0xfe
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.