Page 1 of 1
[fixed] Add a flag for display for no stdin
Posted: 2012-06-04T02:20:37-07:00
by broucaries
Hi,
On debian we are trying to use a desktop file in order to run display
The problem is windows manager use /dev/null as stdin
the desktop entry is
display %f
where %f is an optionnal file if selected on interface.
If we use this we do not get dispaly run from the menu. indeed menu run display.im6 and get /dev/null
We workarround the problem using the following script:
if [ $# -ge 1 ]; then
exec /usr/bin/display.im6 "$@"
else
exec /usr/bin/display.im6 magick:logo
fi
Could you thus add a flag -nostdin that read the file give on the command line and by default display logo ?
Bastien
Re: Add a flag for display for no stdin
Posted: 2012-06-04T21:49:34-07:00
by anthony
I can verify this strange behaviour.
displays an image
(with a tty on stdin) displays 'logo:'
displays 'logo:'
does nothing at all and just exits
This is an error, should be as previous
produces an error 'no decode delegate'. Not input is EOF!
produces an valid error 'improper image header' (from the builtin MIFF coder)
Really display on reading a EOF (even for MIFF) should result in 'no images' and just display logo (unless some other swicth is specified).
Display could use options about whether the 'command widget' or 'image magnification' features should be returned, or perhaps as a new feature, to simply return 'user point picking'... "montage" has a '-mode' option that could be used for similar effect.
Note the big feature 'display' has is -remote option, something few image display programs have... See
http://www.ict.griffith.edu.au/anthony/ ... ontrol.txt
Re: Add a flag for display for no stdin
Posted: 2012-06-05T05:44:20-07:00
by magick
We can reproduce the problem you posted and have a patch. Look for it in ImageMagick-6.7.7-6 Beta by sometime tomorrow. Thanks.
Re: Add a flag for display for no stdin
Posted: 2012-06-05T17:32:08-07:00
by anthony
now displays the logo
The others remain unchanged.
Note if an error occurs in an image so that no valid image results for display, logo will be displayed.
This may not be right. Logo should be displayed if no image is given.
But if an image is given, but errors, then perhaps display should just report error (like it does) and exit without displaying anything.
For example for
where a image is given '-' but errors with 'no decode delegate'
OR
with an error of 'improper image header'.
Also what about 'streaming' image file formats like MIFF and PBMplus?
Zero images in the stream may actually be valid, and not an error?
Would "broucaries" like to comment!