identify console output can't be detected by ruby (and convert works ok)

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.
Post Reply
alex29
Posts: 3
Joined: 2015-04-14T22:44:44-07:00
Authentication code: 6789

identify console output can't be detected by ruby (and convert works ok)

Post by alex29 »

Windows 7, latest ImageMagick-6.9.1-1-Q16-x64-static.exe
Ruby 1.9 and 2.0
When I try

Code: Select all

`convert` 
from Ruby (backticks mean running external command), it catches all the output (help text in this case).
This doesn't happen with

Code: Select all

`identify` 
the result is always "" (empty string).
Tried redirecting error output, etc - nothing helps.
Is the identify's output somehow different from other tools? Is it easy to fix? My script depends on the output, and fails when running in the mentioned configuration (works with Linux at the same time).

PS The only trick that worked was `echo | identify`, but this is only good for Windows then, not for Unix/Linux.
PPS I'm absolutely sure that there are no other tools in the system with the same name.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: identify console output can't be detected by ruby (and convert works ok)

Post by snibgo »

You could check that ...

Code: Select all

convert >c.txt
identify >i.txt
... c.txt and i.txt contain the expected text. They do for me.
snibgo's IM pages: im.snibgo.com
alex29
Posts: 3
Joined: 2015-04-14T22:44:44-07:00
Authentication code: 6789

Re: identify console output can't be detected by ruby (and convert works ok)

Post by alex29 »

Yes, they do.
I can't find any differences in the output, if not trying from Ruby. I suspect 'identify' uses a different method of printing, or some IO-redirection.
alex29
Posts: 3
Joined: 2015-04-14T22:44:44-07:00
Authentication code: 6789

Re: identify console output can't be detected by ruby (and convert works ok)

Post by alex29 »

Found the source of the problem - COMODO firewall that apparently was blocking/sandboxing communications.
Post Reply