code: def make_thumbnail(self, imgfilename_inrst):
          
          builddir = self.env.app.outdir
  
          imgfilename_src = os.path.join(DOC_PATH, imgfilename_inrst)
  
          thumbfilename = self.thumbfilename(imgfilename_inrst)
          thumbfilename_inhtml = os.path.join('_images', thumbfilename)
          thumbfilename_dest = os.path.join(builddir, '_images', thumbfilename)
  
          im = Image.open(imgfilename_src)
          im.thumbnail(thumbnail_size)
          im.save(thumbfilename_dest)
          return thumbfilename_inhtml
docs: Make thumbnail and return (html) path to image
  
          Parameters
          ----------
          imgfilename_rst : rst
              Image filename (relative path), as it appears in the
              ReST file (coverted).