possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post by fmw42 »

On a whim, I tried


convert rose: win:


and it works the way show: used to work. I get the image displayed until I close it.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post by anthony »

fmw42 wrote:On a whim, I tried

Code: Select all

convert rose: win:
and it works the way show: used to work. I get the image displayed until I close it.
can you list the delegate differences between win: and show:?

Also does the IM command actually exit (return to the prompt), leaving the displayed image on screen?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post by anthony »

fmw42 wrote:I changed the show: delegate from miff to png and still it does not work.

I created your slow_display script and added your slow delegate and ran displayed but I got some messages and when I closed the window, I had to force an exit for it to return a prompt and finish

Code: Select all

convert rose: slow:
sleeping
running
freds-mac-mini:~ fred$ sleeping
-bash: sleeping: command not found
freds-mac-mini:~ fred$ running
-bash: running: command not found
freds-mac-mini:~ fred$ finished
Now that is very very weird. the echos from the delegate should not be appearing as typed in commands! It did not come from the keyboard or standard input to the shell so the shell should not have acted as if you typed it.

A terminal program acting like that is dangerious and posibly a security hole as you generally do not want to execute program output!

What terminal program are you using?
Can you run a xterm window and try both the "show:" and "slow:" versions there!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post by fmw42 »

anthony wrote:
fmw42 wrote:On a whim, I tried

Code: Select all

convert rose: win:
and it works the way show: used to work. I get the image displayed until I close it.
can you list the delegate differences between win: and show:?

Also does the IM command actually exit (return to the prompt), leaving the displayed image on screen?

Yes, it actually exits (returns to prompt), leaving the image displayed.

show:
<delegate decode="miff" encode="show" spawn="True" command=""/usr/local/bin/display" -delay 0 -window-group %[group] -title "%l " "ephemeral:%i""/>


win:
<delegate decode="miff" encode="win" stealth="True" spawn="True" command=""/usr/local/bin/display" -immutable -delay 0 -window-group %[group] -title "%l " "ephemeral:%i""/>
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post by fmw42 »

What terminal program are you using?
Can you run a xterm window and try both the "show:" and "slow:" versions there!

It is a bash shell terminal builtin to my Mac OSX Tiger system. Terminal v1.5.1

I am not sure what you mean by xterm. As from opening X11. If so, I have never been able to run IM from that at all. For example:


convert zelda1.jpg show:
bash: convert: command not found

convert zelda1.jpg win:
bash: convert: command not found

However to display any image in the shell terminal window, I first have to start X11 (and quit its xterm to simply get it out of the way)

Correction -- it works if I give the full path to convert in the xterm:

This works:
/usr/local/bin/convert zelda1.jpg win:

This does not:
/usr/local/bin/convert zelda1.jpg show:

This does not work, probably because it cannot find the slow_display script
/usr/local/bin/convert zelda1.jpg slow:
sh: line 1: slow_display: command not found


By the way from the shell bash terminal, this works:


convert zelda1.jpg slow:
sleeping
running
freds-mac-mini:~ fred$ finished


the last line is returned without the finished, until I close the displayed image. But then I have to command period to get a prompt after that.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post by anthony »

Okay, sp you were probbaly cutting and pasteing my output, and not just the "convert" command. Resulting in the command not founds.

The "show:" and "win:" delegates are identical except for an -immutable flag and the "Stealth" setting (means don't list the delegate in a "convert -list delegate" command).

It is very strange that one works and the other does not. Also as the "slow" test delegate works, it does not appear to be a race condition problem.

This problem is very weird!

What happens if you just remove "Stealth" setting from "win:"?
What about just removing "-immutable" from the command?
Does "win:" start going wrong like "show:" does?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post by fmw42 »

Strange! I can change the show delegate to look exactly like the win delegate, but it still does not work. Either I am doing something wrong or not editing the correct delegates.xml. I have been editing the one at /usr/local/etc/ImageMagick/delegates.xml.

Here are the two lines before changing.


<delegate decode="miff" encode="show" spawn="True" command=""/usr/local/bin/display" -delay 0 -window-group %[group] -title "%l " "ephemeral:%i""/>


<delegate decode="miff" encode="win" stealth="True" spawn="True" command=""/usr/local/bin/display" -immutable -delay 0 -window-group %[group] -title "%l " "ephemeral:%i""/>


Here is the edited show:


<delegate decode="miff" encode="show" stealth="True" spawn="True" command=""/usr/local/bin/display" -immutable -delay 0 -window-group %[group] -title "%l " "ephemeral:%i""/>

But this edited line still does not make the show: work to display an image.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post by anthony »

Check the 'Path' entries in

Code: Select all

convert -list delegate
is that file actually being used by IM?

It certainly seems strange.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post by fmw42 »

anthony wrote:Check the 'Path' entries in

Code: Select all

convert -list delegate
is that file actually being used by IM?

It certainly seems strange.

Seems to be the right file:


convert -list delegate

Path: /usr/local/etc/ImageMagick/delegates.xml


Could it be that both show: and win: are assigned to miff?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post by anthony »

That is just the encoding for the input image into the output delegate.

perhaps 'show' is being defined before your version. remember only the first definition will be used. This is why you can't define your own version of show in a user 'delagate.xml' (its a security measure).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post by fmw42 »

anthony wrote:That is just the encoding for the input image into the output delegate.

perhaps 'show' is being defined before your version.

How would I check this? Is there some other file that might have delegates defined in it?

There is only one show delegate defined in my delegates.xml file. I just checked.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post by anthony »

The order is as per the 'path' of the list though there can be an internal definition too (first part)
This is one reason I hate "Stealth=True" if an internal defination is stealth you can't know it without going through sources.
:-(
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post by fmw42 »

Is it possible that IM is using the old location for delegates.xml before it was moved to /usr/local/etc/Imagemagick? And if so, where was that, so I can check if that files exists there? Also where is $MAGICK_CONFIGURE_PATH? Which is listed as the first place it looks when I read the Resources page.

I only see two places for it in /usr

find /usr | grep "delegates.xml"

/usr/local/etc/ImageMagick/delegates.xml
/usr/local/share/doc/ImageMagick-6.7.1/www/source/delegates.xml
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post by anthony »

the /usr/local/share is just a documentation directory and should not be listed in the -list output.

My own version lists three paths my personal, system and then my personal again -- now that seems wierd to me!

You could add a "echo show;" into the delegate so that it prints something when executed. that will at least let you know if the delegate gets called.

Alternativate add "set -x;" to ask the shell running the delegate to repeat the command that it is executing.

I think I am reaching the end of my suggestions, without being 'hands on' myself.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug show: in IM 6.7.1.0 Q16 Mac OSX

Post by fmw42 »

set -x;
+ set -x

convert zelda1.jpg show:
+ convert zelda1.jpg show:

Still no image display.





<delegate decode="miff" encode="show" spawn="True" command=""/usr/local/bin/display" -delay 0 -window-group %[group] -title "%l " "ephemeral:%i"" echo show;/>


convert zelda1.jpg show:

I get no echo and no image showing.
Post Reply