def visit_image(self, node):
        olduri = node['uri']
        # rewrite the URI if the environment knows about it
        if olduri in self.builder.images:
            node['uri'] = posixpath.join(self.builder.imgpath,
                                         self.builder.images[olduri])

        if 'scale' in node:
            # Try to figure out image height and width.  Docutils does that too,
            # but it tries the final file name, which does not necessarily exist
            # yet at the time the HTML file is written.
            if PIL and not ('width' in node and 'height' in node):
                try:
                    im = PIL.Image.open(os.path.join(self.builder.srcdir,
                                                     olduri))
                except (__HOLE__, # Source image can't be found or opened
                        UnicodeError):  # PIL doesn't like Unicode paths.
                    pass
                else:
                    if 'width' not in node:
                        node['width'] = str(im.size[0])
                    if 'height' not in node:
                        node['height'] = str(im.size[1])
                    del im
        BaseTranslator.visit_image(self, node)
dataset/ETHPy150Open zackw/header-survey/sphinx/ext/html5_output.py/HTML5Translator.visit_image