No Decode Delegate when using stdin
-
- Posts: 3
- Joined: 2012-04-19T12:08:34-07:00
- Authentication code: 13
No Decode Delegate when using stdin
I am having a problem when passing an image to ImageMagick via stdin.
The following command is the one in question.
$ display < frog.pgm
display: no decode delegate for this image format `/var/tmp/magick-2094Xb6fonFohOuc' @ error/constitute.c/ReadImage/550.
However,
display frog.pgm
works just fine.
Interestingly, this works fine on Ubuntu but is not working on the Mac distribution.
Any thoughts?
The following command is the one in question.
$ display < frog.pgm
display: no decode delegate for this image format `/var/tmp/magick-2094Xb6fonFohOuc' @ error/constitute.c/ReadImage/550.
However,
display frog.pgm
works just fine.
Interestingly, this works fine on Ubuntu but is not working on the Mac distribution.
Any thoughts?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: No Decode Delegate when using stdin
try piping the output from your other tool something equivalent to
convert rose: PGM:- | display -
convert rose: PGM:- | display -
-
- Posts: 3
- Joined: 2012-04-19T12:08:34-07:00
- Authentication code: 13
Re: No Decode Delegate when using stdin
Unfortunately, the same error message comes up.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: No Decode Delegate when using stdin
Do you have X11 installed. IM display needs X11 (unix and mac)
Re: No Decode Delegate when using stdin
We experience the same problem.
doesn't work.
works. Same e. g. for png. So it seems that the type of image is not correctly recognized.
See
https://bugzilla.novell.com/show_bug.cgi?id=882456
Code: Select all
cat any.jpg | display
Code: Select all
cat any.jpg | display jpg:-
See
https://bugzilla.novell.com/show_bug.cgi?id=882456
Reporter said that display works for him, no?fmw42 wrote:Do you have X11 installed. IM display needs X11 (unix and mac)
Re: No Decode Delegate when using stdin
Hmm,
works.
Code: Select all
cat any.png | display -
Re: No Decode Delegate when using stdin
It seems that block 0000 - 0fff of the stdin is not copyied into temporary file in the wrong case.
Re: No Decode Delegate when using stdin
In the correct case:
In the wrong case:
The first 'wrong' read is thanks to DisplayImageCommand() behaviour, which is checking with getc() if there is some input on stdin or not. So at the end, it looks like:
Code: Select all
read(0, "\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\0\30\0\0\0\30\10\6\0\0\0\340w="..., 262142) = 4380
read(0, "", 257762) = 0
read(0, "", 262142)
Code: Select all
read(0, "\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\0\30\0\0\0\30\10\6\0\0\0\340w="..., 4096) = 4096
read(0, "=I\22\202c\307\216\21\4\1\3\3\3W\327\33\r=;[y\241\263\263\263\305\267\2161I\262\261"..., 262142) = 284
read(0, "", 261858) = 0
read(0, "", 262142)
Code: Select all
char c, buffer[N];
c = getc(stdin); /* DisplayImageCommand() */
ungetc(c, stdin); /* DisplayImageCommand() */
read(0, buffer, N); /* ReadBlob() */
Re: No Decode Delegate when using stdin
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.9-4 Beta available within a few days. Thanks.
Re: No Decode Delegate when using stdin
Excelent, thanks! May I have the patch, please?