def import_imageinfo(path, base = nil, allow_exts = nil)
      return nil unless File.exist?(path)
      allow_exts ||= @config['image_ext']
      Dir.foreach(path) do |f|
        next if f.start_with?('.')
        if f =~ /\.(#{allow_exts.join('|')})\Z/i
          path.chop! if path =~ %r{/\Z}
          if base.nil?
            @contents.push(EPUBMaker::Content.new('file' => "#{path}/#{f}"))
          else
            @contents.push(EPUBMaker::Content.new('file' => "#{path.sub(base + '/', '')}/#{f}"))
          end
        end
        if FileTest.directory?("#{path}/#{f}")
          import_imageinfo("#{path}/#{f}", base)
        end
      end
    end
def import_imageinfo(path, base = nil, allow_exts = nil)
      return nil unless File.exist?(path)
      allow_exts ||= @config['image_ext']
      Dir.foreach(path) do |f|
        next if f.start_with?('.')
        if f =~ /\.(#{allow_exts.join('|')})\Z/i
          path.chop! if path =~ %r{/\Z}
          if base.nil?
            @contents.push(EPUBMaker::Content.new('file' => "#{path}/#{f}"))
          else
            @contents.push(EPUBMaker::Content.new('file' => "#{path.sub(base + '/', '')}/#{f}"))
          end
        end
        if FileTest.directory?("#{path}/#{f}")
          import_imageinfo("#{path}/#{f}", base)
        end
      end
    end
Add informations of figure files in +path+ to contents array.
 +base+ defines a string to remove from path name.