summaryrefslogtreecommitdiff
path: root/pywal
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-03-05 09:13:52 +0200
committerDylan Araps <dylan.araps@gmail.com>2019-03-05 09:13:52 +0200
commit2f8d458f8916e31cd9b5a0045510e70d86ae42cd (patch)
treeeef03035cc8df6bc9738500d66aec6fb2be27dc9 /pywal
parent0f7c6aeaf9eda9a5062b78950a60ca72771388a7 (diff)
general: Add file size to caching to avoid collisions. Closes #385
Diffstat (limited to 'pywal')
-rw-r--r--pywal/colors.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pywal/colors.py b/pywal/colors.py
index 86db9c4..99d346d 100644
--- a/pywal/colors.py
+++ b/pywal/colors.py
@@ -87,9 +87,11 @@ def cache_fname(img, backend, light, cache_dir, sat=""):
"""Create the cache file name."""
color_type = "light" if light else "dark"
file_name = re.sub("[/|\\|.]", "_", img)
+ file_size = os.path.getsize(img)
- file_parts = [file_name, color_type, backend, sat, __cache_version__]
- return [cache_dir, "schemes", "%s_%s_%s_%s_%s.json" % (*file_parts,)]
+ file_parts = [file_name, color_type, backend,
+ sat, file_size, __cache_version__]
+ return [cache_dir, "schemes", "%s_%s_%s_%s_%s_%s.json" % (*file_parts,)]
def get_backend(backend):