def process_draw_image( element, output_node )
      pic_name = element.attribute("#{@xlink_ns}:href").value
      if (@image_dir != nil) then
        img = emit_element( output_node, "img" )
        img.attributes["alt"] = pic_name

        # Get rid of everything before the last / in the filename
        base_name = pic_name;
        if ((pos = base_name.rindex('/')) != nil) then
          base_name = base_name[pos + 1 .. -1]
        end
        copy_image_file( pic_name, @image_dir, base_name )
        img.attributes["src"] = "#{@image_dir}/#{base_name}"
        width = element.parent.attribute("#{@svg_ns}:width")
        height= element.parent.attribute("#{@svg_ns}:height")
        if (width != nil && height != nil) then
          img.attributes["style"] = "width:#{width.value}; " +
            "height:#{height.value}"
        end
      else
        div = emit_element( output_node, "div" )
        div.add_text( pic_name )
      end
    end
def process_draw_image( element, output_node )
      pic_name = element.attribute("#{@xlink_ns}:href").value
      if (@image_dir != nil) then
        img = emit_element( output_node, "img" )
        img.attributes["alt"] = pic_name

        # Get rid of everything before the last / in the filename
        base_name = pic_name;
        if ((pos = base_name.rindex('/')) != nil) then
          base_name = base_name[pos + 1 .. -1]
        end
        copy_image_file( pic_name, @image_dir, base_name )
        img.attributes["src"] = "#{@image_dir}/#{base_name}"
        width = element.parent.attribute("#{@svg_ns}:width")
        height= element.parent.attribute("#{@svg_ns}:height")
        if (width != nil && height != nil) then
          img.attributes["style"] = "width:#{width.value}; " +
            "height:#{height.value}"
        end
      else
        div = emit_element( output_node, "div" )
        div.add_text( pic_name )
      end
    end
Copy an image into user-specified directory, and emit
 a corresponding <tt>&lt;img&gt;</tt> element.

 If the user has not specified an image directory,
 then emit a <tt>&lt;div&gt;</tt> containing the
 file name.