You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defis_complete(self):
""" Returns true if the video buffer is entirely opaque. """ifself.dataisNone:
returnFalsereturnself.data[:, :, self.mode.index('a')].all()
Where the whole screenshot is not being filled so .all() returns false, then this loop:
asyncdefscreenshot(self, x: int=0, y: int=0, width: Optional[int] =None, height: Optional[int] =None):
""" Takes a screenshot and returns a 3D RGBA array. """self.video.data=Noneself.video.refresh(x, y, width, height)
whileTrue:
update_type=awaitself.read()
ifupdate_typeisUpdateType.VIDEO:
ifself.video.is_complete():
returnself.video.as_rgba()
the if self.video.is_complete() is false, so the while True loop loops again, which goes back to self.read(), which then eventually goes all the way down to streams.py to this bit of code:
asyncdef_wait_for_data(self, func_name):
"""Wait until feed_data() or feed_eof() is called. If stream was paused, automatically resume it. """# StreamReader uses a future to link the protocol feed_data() method# to a read coroutine. Running two read coroutines at the same time# would have an unexpected behaviour. It would not possible to know# which coroutine would get the next data.ifself._waiterisnotNone:
raiseRuntimeError(
f'{func_name}() called while another coroutine is 'f'already waiting for incoming data')
assertnotself._eof, '_wait_for_data after EOF'# Waiting for data while paused will make deadlock, so prevent it.# This is essential for readexactly(n) for case when n > self._limit.ifself._paused:
self._paused=Falseself._transport.resume_reading()
self._waiter=self._loop.create_future()
try:
awaitself._waiterfinally:
self._waiter=None
Where the code waits forever at await self._waiter
I am trying to do a screenshot of a docker container which runs firefox and a vnc, you can run this yourself like:
I then want to take a screenshot and reduce the image size so it hopefully runs faster:
The code seems to get stuck on an infinite loop somewhere (hard for me to find out where).
On a separate note, what I really want to do is lower the resolution but keep the whole screen size, do you know if this is possible?
Thanks!
The text was updated successfully, but these errors were encountered: