[l2h] Don't check image type if -noimage

Scot Woodward scot_woodward@yahoo.com
Thu, 4 Apr 2002 13:40:39 -0800 (PST)


Howdy!

I'm using l2h on a workstation which doesn't have graphics conversion
utilities (and on which I don't have root access), so I've decided to
do all my image handling with "\htmladdimg" (and to avoid using math
mode).  In theory, I'd then be able to get what I want by using the
"-noimages" option.

Sadly, l2h still complains about not having a valid image type:

Error: No such image type ''.
       This installation supports (first is default):


This is obviously happening because of the following bit of code:

--- begin fragment ---
unless(grep(/^\Q$IMAGE_TYPE\E$/o, @IMAGE_TYPES)) {
    die <<"EOF";
Error: No such image type '$IMAGE_TYPE'.
       This installation supports (first is default): @IMAGE_TYPES
EOF
}
--- end fragment ---


I only know approximately (1.5 * jack) about Perl, but I did manage
to figure out that I'd get it to work if I surround this with some
simple conditional code:

--- begin fragment ---
if ($opt{images}) {
    unless(grep(/^\Q$IMAGE_TYPE\E$/o, @IMAGE_TYPES)) {
        die <<"EOF";
Error: No such image type '$IMAGE_TYPE'.
       This installation supports (first is default): @IMAGE_TYPES
EOF
    }
}
--- end fragment ---


I suggest that this be included in future versions.  I generated
a diff file, but I've never done this sort of thing before, so I
probably screwed it up somehow:

--- begin diff ---
397,398c397,399
< unless(grep(/^\Q$IMAGE_TYPE\E$/o, @IMAGE_TYPES)) {
<     die <<"EOF";
---
> if ($opt{images}) {
>     unless(grep(/^\Q$IMAGE_TYPE\E$/o, @IMAGE_TYPES)) {
>         die <<"EOF";
401a403
>     }
--- end diff ---


Thanks for listening.
SW

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/