Page 1 of 1

Supported formats list is inaccurate

Posted: 2010-11-19T13:57:26-07:00
by cch1
I'm using ImageMagick through the API (from RMagick) but I see the same problem using the identify command:

Code: Select all

[cch1@osprey ~]$ identify -list format | grep " HTML\*"
     HTML* HTML      -w-   Hypertext Markup Language and a client-side image map
IM can clearly read HTML files:

Code: Select all

[cch1@osprey ~]$ convert index.html index.png
Retrieving http://asset1.hweb.com/images/new_logo.png?1289888389
[cch1@osprey ~]$ 
I expected 'identify' (and the equivalent Magick::Formats in Ruby) to show that reading of HTML is supported.

Without an accurate report of available input formats, it's hard to automate processing of user input in my application.

Re: Supported formats list is inaccurate

Posted: 2010-11-19T13:58:40-07:00
by cch1
One more comment: thanks to grepper on #imagemagick for helping me confirm this bug and suggesting I post it here.

-Chris (cch1)

Re: Supported formats list is inaccurate

Posted: 2010-11-20T07:19:15-07:00
by glennrp
IM can only read HTML files if the "html2ps" delegate is present, and IM is actually reading a PostScript rendition of the html. In coders/html.c there only exists a writer that is registered.

Re: Supported formats list is inaccurate

Posted: 2010-11-22T08:08:09-07:00
by cch1
glennrp wrote:IM can only read HTML files if the "html2ps" delegate is present, and IM is actually reading a PostScript rendition of the html. In coders/html.c there only exists a writer that is registered.
glennrp,
Pardon the liberty, but I'm going to try to paraphrase your comment...

"IM delegates the reading of HTML and thus has no inherent knowledge of whether reading of HTML is supported"

If that is true, it is unfortunate that the returned capabilities string "-w-" implies that it cannot read HTML instead of being explicit about the lack of information. The capabilities string is rendered useless for automated determination of supported formats.

If you are in a position to influence the direction of IM, might I suggest " " or "?" if the status of support is unknown? For HTML that would be:

"?w-"

-Chris