ponty / pyscreenshot

Python screenshot library, replacement for the Pillow ImageGrab module on Linux.
BSD 2-Clause "Simplified" License
499 stars 89 forks source link

Same snapshots #26

Closed coeusite closed 8 years ago

coeusite commented 9 years ago

Hi, I met a problem using pyscreenshot on Fedora 22 x64 with Python 2.7 and Pillow 3.0.

When using pyscreenshot, I would always obtain the exactly same snapshot unless I quit python and restart it. Why does it happen?

It does not occur if I change backend to imagemagick.

ponty commented 9 years ago

Can you provide more information? (sample program, log,..) Which back-end doesn't work?

coeusite commented 8 years ago

For me, wxPython doesn't work. imagemagick does work (change 'wx' to 'imagemagick')

There is no error reported.

Python 2.7.10 (default, Sep  8 2015, 17:20:17) 
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyscreenshot as ImageGrab
>>> im=ImageGrab.grab(backend='wx')
>>> im.show() 
>>> im
<PIL.Image.Image image mode=RGB size=1920x1080 at 0x7F972A4F13D0>

# everything seems correct here. 
# move the windows

>>> im2=ImageGrab.grab(backend='wx')
>>> im2.show()
>>> im2
<PIL.Image.Image image mode=RGB size=1920x1080 at 0x7F972A4FA1D0>

# im and im2 show the same image.

Versions

pyscreenshot         0.4
wx                   3.0.2.0
pygtk                2.28.6
pyqt                 not implemented
scrot                missing
imagemagick          6.9.1

Update: I'm using GNOME. I did try to use wxPython to capture a snapshot directly, and the same situation showed up.

ponty commented 8 years ago

Sorry for late answer. I have the same wx version on Ubuntu, but without error. I put the call in a child process (#27) , this may help. If not, then other back-end (like scrot) should be used.

coeusite commented 8 years ago

thank you!