fix 1024x1024 guessing + fix Makefile uninstall

This commit is contained in:
relikd
2021-10-11 01:39:13 +02:00
parent 63d2fc4f42
commit 01b94459cb
2 changed files with 5 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ install:
uninstall:
python3 -m pip uninstall icnsutil
rm -rf ./*.egg-info/
-rm -i "$$(which icnsutil)"
.PHONY: test
test:

View File

@@ -254,12 +254,16 @@ def guess(data: bytes, filename: Optional[str] = None) -> Media:
# Guess by image size and retina flag
size = RawData.determine_image_size(data, ext) if ext else None
retina = bname.lower().endswith('@2x') if filename else False
if size == (1024, 1024):
retina = True # stupid double usage of ic10
# Icns specific names
desc = None
if ext == 'icns' and filename:
for candidate in ['template', 'selected', 'dark']:
if filename.endswith(candidate + '.icns'):
desc = candidate
break
choices = []
for x in _TYPES.values():