maoschanz / drawing

Simple image editor for Linux
https://maoschanz.github.io/drawing/
GNU General Public License v3.0
784 stars 101 forks source link

Clipboard from command line throws error. #614

Closed loquilloll closed 1 year ago

loquilloll commented 1 year ago

Open from command line with the clipboard option results in an error. It will copy from clipboard in the new image menu with "New Image From Clipboard"

$ drawing -c Traceback (most recent call last): File "/usr/lib/python3/dist-packages/drawing/window.py", line 344, in on_active_tab_changed self.switch_to(self.active_tool_id, args[1]) File "/usr/lib/python3/dist-packages/drawing/window.py", line 909, in switch_to self.former_tool().give_back_control(should_preserve_selection) File "/usr/lib/python3/dist-packages/drawing/abstract_tool.py", line 255, in give_back_control self.restore_pixbuf() File "/usr/lib/python3/dist-packages/drawing/abstract_tool.py", line 327, in restore_pixbuf self.get_image().use_stable_pixbuf() File "/usr/lib/python3/dist-packages/drawing/image.py", line 572, in use_stable_pixbuf self.surface = Gdk.cairo_surface_create_from_pixbuf(self.main_pixbuf, 0, None) ^^^^^^^^^^^^^^^^ AttributeError: 'DrImage' object has no attribute 'main_pixbuf'. Did you mean: 'set_main_pixbuf'?

$ drawing -v Drawing 1.0.2

Ubuntu 23.04 Gnome 44.3 Wayland=True

loquilloll commented 1 year ago

I found the issue. wl-copy -ot image/png < image.img wasn't copying anything into the clipboard. Omitting the -o option and using wl-copy -t image/png < image.img works.

The error mentioned still occurs but it probably has nothing to do with the clipboard.

maoschanz commented 1 year ago

i reopen to fix the error even if it's unrelated