LinuxCNC / linuxcnc

LinuxCNC controls CNC machines. It can drive milling machines, lathes, 3d printers, laser cutters, plasma cutters, robot arms, hexapods, and more.
http://linuxcnc.org/
GNU General Public License v2.0
1.77k stars 1.14k forks source link

module 'PIL.Image' has no attribute 'ANTIALIAS' #2825

Closed garyemiller closed 8 months ago

garyemiller commented 8 months ago

Just built on Gentoo from git head:

$ bin/image-to-gcode /tmp/Screenshot_2024-01-02_12-38-54.png 
/home/gem/src/linuxcnc/bin/image-to-gcode:772: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
  nim = numpy.fromstring(tobytes(im), dtype=numpy.uint8).reshape((h, w)).astype(numpy.float32)
Traceback (most recent call last):
  File "/home/gem/src/linuxcnc/bin/image-to-gcode", line 837, in <module>
    main()
  File "/home/gem/src/linuxcnc/bin/image-to-gcode", line 773, in main
    options = ui(im, nim, im_name)
              ^^^^^^^^^^^^^^^^^^^^
  File "/home/gem/src/linuxcnc/bin/image-to-gcode", line 522, in ui
    ui_image = im.resize((nw,nh), Image.ANTIALIAS)
                                  ^^^^^^^^^^^^^^^
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'
havardAasen commented 8 months ago

If you are using master, the fix was included a couple of hours ago.

garyemiller commented 8 months ago

Works now. Thanks!

I do get this:

/home/gem/src/linuxcnc/bin/image-to-gcode:772: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
  nim = numpy.fromstring(tobytes(im), dtype=numpy.uint8).reshape((h, w)).astype(numpy.float32)

Should I file a new issue on that?

havardAasen commented 8 months ago
/home/gem/src/linuxcnc/bin/image-to-gcode:772: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
  nim = numpy.fromstring(tobytes(im), dtype=numpy.uint8).reshape((h, w)).astype(numpy.float32)

Should I file a new issue on that?

No need, I created #2843 to fix that.

garyemiller commented 8 months ago

Thanks!