repaper / gratis

EPD Source codes and Documentation
238 stars 132 forks source link

Using `tobytes()` instead of deprecated `tostring()` #35

Closed WebReflection closed 8 years ago

WebReflection commented 8 years ago

Simply trying on ArchLinux the counter command there is an error:

$ python2 demo/CounterDemo.py 3 20
panel = EPD 2.0 200 x 96  version=4 COG=2 FILM=231
Traceback (most recent call last):
  File "demo/CounterDemo.py", line 99, in <module>
    main(sys.argv[1:])
  File "demo/CounterDemo.py", line 67, in main
    demo(epd, start)
  File "demo/CounterDemo.py", line 90, in demo
    epd.display(image)
  File "/home/sinon/gratis/PlatformWithOS/demo/EPD.py", line 139, in display
    f.write(image.tostring())
  File "/usr/lib/python2.7/site-packages/PIL/Image.py", line 686, in tostring
    "Please call tobytes() instead.")
Exception: tostring() has been removed. Please call tobytes() instead.

The error appears in every demo but with this change it disappears and works without problems.

hxw commented 8 years ago

thanks for the fix