private function stripFormatExtension($path, $format)
    {
        $extension = '.' . $format;
        if (substr($path, -strlen($extension)) === $extension) {
            $path = substr($path, 0, strlen($path) - strlen($extension));
        }

        return $path;
    }