0

I have been requested to make a Python file in order to capture screenshots at regular intervals on a minimal Windows XP machine (sadly), for obvious compatibility reasons I used Python 2.7.10 X86.

The application works as expected on Windows 10 using the same Python version (32 Bits), but does not work on the Windows XP machine.

opencv-python neither Pillow are working, they both indicate that the specified procedure can't be found.

I think that the issue is related to missing dependencies, especially when the XP machine is minimalist...

To be more precise, the python file crashes at "import cv2" line.

If there are any other screenshots and image comparison libraries I'd be glad to know!

The last resort would be going to a lower level, finding the value from it's memory address (from the app), saving it and comparing the old value with the new one, however I wonder if this is even possible with Python...

Thank you for reading, any help appreciated!

EDIT : Sorry I have forgot to mention that I need to make a comparison with the previous image. I used : ImageChops.difference(a, b)

Community
  • 1
  • 1
Jean Meier
  • 33
  • 7
  • if you only need to save a screenshot, without any processing, then you don't need opencv at all. One option is pyautogui: [https://pyautogui.readthedocs.io/en/latest/screenshot.html](https://pyautogui.readthedocs.io/en/latest/screenshot.html) – Sane_or_not Jan 10 '20 at 09:56

2 Answers2

0

Finally, I went for using Pillow instead of cv2 and especially using pip install Pillow==4.0 to resolved the DLL Load Failed (they were both concerned) but I end up having a new conflict which is :

IOError: encoder zip not available

I am making my investigations, but for more details neither doing :

image = grab()
image.save("captures/capture.png")

or

image = pyautogui.screenshot("captures/capture.png")

produces any results so far... :(

Jean Meier
  • 33
  • 7
  • Alright, instead of using png or jpg, I used GIF, screenshots works, comparison works, however if someone has hints about the issue I mentioned with encoder, i'll be glad to hear it, hope this help other people too! – Jean Meier Jan 10 '20 at 13:11
0

Change

image = pyautogui.screenshot("captures/capture.png")

to

image = pyautogui.screenshot(r"captures/capture.png")

Sane_or_not
  • 146
  • 8