From f80e31243b61521c26994bf8e57256ea39cb824e Mon Sep 17 00:00:00 2001 From: wucke13 Date: Wed, 13 May 2026 23:02:22 +0200 Subject: [PATCH] fix: image-to-gcode.py for modern numpy/tkinter - Numpy renamed `numpy.core.Inf` -> `numpy.core.inf`. - However, `numpy.core` was also deprecated and renamed, hence it would be `numpy._core.inf`. - But really, `numpy.inf` does work too. - Avoid closing the `tkinter._default_root`, it's not necessary anymore (probably since https://github.com/python/cpython/pull/23897). Nowadays, there isn't even a `tkinter._default_root` per default. Signed-off-by: wucke13 --- src/emc/usr_intf/axis/scripts/image-to-gcode.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/emc/usr_intf/axis/scripts/image-to-gcode.py b/src/emc/usr_intf/axis/scripts/image-to-gcode.py index 1e96de2dc93..c863e750084 100644 --- a/src/emc/usr_intf/axis/scripts/image-to-gcode.py +++ b/src/emc/usr_intf/axis/scripts/image-to-gcode.py @@ -30,8 +30,8 @@ def cmp(a, b): except ImportError: import Image -import numpy.core -plus_inf = numpy.core.Inf +import numpy +plus_inf = numpy.inf from rs274.author import Gcode import rs274.options @@ -754,7 +754,6 @@ def main(): if len(sys.argv) > 1: im_name = sys.argv[1] else: - import tkinter import tkinter.filedialog as tkFileDialog im_name = tkFileDialog.askopenfilename(defaultextension=".png", @@ -762,8 +761,6 @@ def main(): (_("Depth images"), ".gif .png .jpg"), (_("All files"), "*"))) if not im_name: raise SystemExit - tkinter._default_root.destroy() - tkinter._default_root = None im = Image.open(im_name) size = im.size im = im.convert("L") #grayscale