Picture dialog and stdin

106 views
Skip to first unread message

Misko

unread,
Apr 15, 2022, 6:34:26 PM4/15/22
to yad-common
I'm trying to add --listen option to the picture dialog

echo -e \f   would clear an image.

2 issues so far...
It takes a lot for app to exit after the dialog is closed.
while sleep 10 ; do echo "$(find "$HOME/Pictures" -type f -name '*.jpg' -o -name '*.png' -name '*.gif' | shuf -n 1)" ; done \
| yad --picture --listen --height=800 --width=580

Also image is miss-positioned with --size= fit option
while sleep 1 ; do echo "$(find "$HOME/Pictures" -type f -name '*.jpg' -o -name '*.png' -name '*.gif'  | shuf -n 1)" ; done \
| yad --picture --listen --height=800 --width=580 --size=fit

Victor Ananjevsky

unread,
Apr 25, 2022, 11:34:04 AM4/25/22
to yad-c...@googlegroups.com
i'm not sure that the load images from stdin is a good idea
take a look at latest git, i've added ability to load several images

Fri, 15 Apr 2022 15:34:26 -0700 (PDT)
Misko <mpsr...@gmail.com> написав:
--
wbr
Victor Ananjevsky <vic...@sanana.kiev.ua>

Misko

unread,
Apr 27, 2022, 7:01:03 PM4/27/22
to yad-common
Checked the latest git.
It loads several images and the keyboard shortcuts are working.
hook on image changed is working --image-changed="echo %s"
--file-op works fine with --text-info
These are great additions to yad.

With picture dialog it segfaults after selecting open from the menu again
yad --picture --file-op
# open -> select a few images

# second open -> select a few images
(yad:392482): GLib-GObject-CRITICAL **: 00:49:49.682: g_object_ref_sink: assertion 'G_IS_OBJECT (object)' failed

(yad:392482): Gtk-CRITICAL **: 00:49:49.683: gtk_file_filter_get_name: assertion 'GTK_IS_FILE_FILTER (filter)' failed

(yad:392482): GLib-GObject-CRITICAL **: 00:49:49.683: g_object_ref_sink: assertion 'G_IS_OBJECT (object)' failed

(yad:392482): Gtk-CRITICAL **: 00:49:49.683: gtk_file_filter_get_name: assertion 'GTK_IS_FILE_FILTER (filter)' failed

(yad:392482): Gtk-CRITICAL **: 00:49:49.718: _gtk_file_system_model_set_filter: assertion 'filter == NULL || GTK_IS_FILE_FILTER (filter)' failed

(yad:392482): GLib-GObject-CRITICAL **: 00:49:53.810: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(yad:392482): GLib-GObject-CRITICAL **: 00:49:53.810: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
Segmentation fault

Victor Ananjevsky

unread,
Apr 27, 2022, 11:21:16 PM4/27/22
to yad-c...@googlegroups.com
hi

thanks for reporting, fixed.

Wed, 27 Apr 2022 16:01:03 -0700 (PDT)

Misko

unread,
May 1, 2022, 9:21:35 AM5/1/22
to yad-common
Compiled and all is working, thank you.
I hope it's ok, I've pushed a small change to run the image changed hook just after the image is loaded via file chooser.

Misko

unread,
May 1, 2022, 10:31:18 AM5/1/22
to yad-common
Another segfault
 yad --picture --file-op --image-changed="echo %s"
# Left / Right / Home /End keyboard key pressed
Segmentation fault
It only happens with --image-changed option and no image is loaded.

Misko

unread,
May 1, 2022, 10:51:19 AM5/1/22
to yad-common

Misko

unread,
May 1, 2022, 11:11:36 AM5/1/22
to yad-common
 Although, on second thought, this would be better :)
  if (options.picture_data.change_cmd == NULL || !img)
    return;
Reply all
Reply to author
Forward
0 new messages