From a9cf29a7dd4896e2b70af59ca809f1b7f649ceea Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Tue, 18 Apr 2017 22:51:14 +0200 Subject: [PATCH] Update optimize --- guetzli-recursively.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/guetzli-recursively.py b/guetzli-recursively.py index fde4c7c..b39a28f 100644 --- a/guetzli-recursively.py +++ b/guetzli-recursively.py @@ -10,9 +10,10 @@ TYPES = ('jpeg',) for dirpath, dirnames, files in walk(top_dir): for name in files: - if what(path.join(dirpath, name)) in TYPES: + url = path.join(dirpath, name) + # Check type + if what(url) in TYPES: # Get urls - url = path.join(dirpath, name) print(url) url_out = path.join(top_dir, TEMP_FILE) # Remove temp image