def METHOD_NAME(self, load_until_layer=0):
    """Load metadata from an extracted docker image. This assumes the
    image has already been downloaded and extracted into the working
    directory"""
    if load_until_layer > 0:
        self._load_until_layer = load_until_layer
    # else defaults to 0 - handles negative load_until_layer
    try:
        self._manifest = self.get_image_manifest()
        self.__repotags = self.get_image_repotags(self._manifest)
        self._config = self.get_image_config(self._manifest)
        self.__history = self.get_image_history(self._config)
        layer_paths = self.get_image_layers(self._manifest)
        layer_diffs = self.get_diff_ids(self._config)
        checksum_type = self.get_diff_checksum_type(self._config)
        layer_count = 1
        while layer_diffs and layer_paths:
            layer = ImageLayer(layer_diffs.pop(0), layer_paths.pop(0))
            # Only load metadata for the layers we need to report on
            # according to the --layers command line option
            # If  --layers option is not present, load all the layers
            if (self.load_until_layer >= layer_count
                    or self.load_until_layer == 0):
                layer.set_checksum(checksum_type, layer.diff_id)
                layer.image_layout = "docker"
                layer.gen_fs_hash()
                layer.layer_index = layer_count
                self._layers.append(layer)
            layer_count = layer_count + 1
        self._total_layers = layer_count - 1
        if self.load_until_layer > self.total_layers:
            # if user asked to analyze more layers than image has
            # turn off the load_until_layer feature
            self._load_until_layer = 0
        self.set_layer_created_by()
    except NameError as e:
        raise NameError(e) from e
    except subprocess.CalledProcessError as e:
        raise subprocess.CalledProcessError(
            e.returncode, cmd=e.cmd, output=e.output, stderr=e.stderr)
    except IOError as e:
        raise IOError(e) from e