Supported formats list is inaccurate

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
cch1

Supported formats list is inaccurate

Post 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.
cch1

Re: Supported formats list is inaccurate

Post by cch1 »

One more comment: thanks to grepper on #imagemagick for helping me confirm this bug and suggesting I post it here.

-Chris (cch1)
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Supported formats list is inaccurate

Post 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.
cch1

Re: Supported formats list is inaccurate

Post 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
Post Reply