From abee36dc6efa1bf659294b5684e840c98e5126e6 Mon Sep 17 00:00:00 2001 From: amyasnikov Date: Mon, 29 Oct 2018 10:21:55 +0300 Subject: [PATCH] Ignore unexpected files --- mbutil/util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mbutil/util.py b/mbutil/util.py index 50f581c..35cf5b6 100755 --- a/mbutil/util.py +++ b/mbutil/util.py @@ -222,6 +222,8 @@ def disk_to_mbtiles(directory_path, mbtiles_file, **kwargs): logger.warning("Your OS is MacOS,and the .DS_Store file will be ignored.") else: file_name, ext = current_file.split('.',1) + if (ext != image_format and ext != 'grid.json'): + continue f = open(os.path.join(directory_path, zoom_dir, row_dir, current_file), 'rb') file_content = f.read() f.close()