fix 1024x1024 guessing + fix Makefile uninstall
This commit is contained in:
1
Makefile
1
Makefile
@@ -13,6 +13,7 @@ install:
|
|||||||
uninstall:
|
uninstall:
|
||||||
python3 -m pip uninstall icnsutil
|
python3 -m pip uninstall icnsutil
|
||||||
rm -rf ./*.egg-info/
|
rm -rf ./*.egg-info/
|
||||||
|
-rm -i "$$(which icnsutil)"
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
|
|||||||
@@ -254,12 +254,16 @@ def guess(data: bytes, filename: Optional[str] = None) -> Media:
|
|||||||
# Guess by image size and retina flag
|
# Guess by image size and retina flag
|
||||||
size = RawData.determine_image_size(data, ext) if ext else None
|
size = RawData.determine_image_size(data, ext) if ext else None
|
||||||
retina = bname.lower().endswith('@2x') if filename else False
|
retina = bname.lower().endswith('@2x') if filename else False
|
||||||
|
if size == (1024, 1024):
|
||||||
|
retina = True # stupid double usage of ic10
|
||||||
|
|
||||||
# Icns specific names
|
# Icns specific names
|
||||||
desc = None
|
desc = None
|
||||||
if ext == 'icns' and filename:
|
if ext == 'icns' and filename:
|
||||||
for candidate in ['template', 'selected', 'dark']:
|
for candidate in ['template', 'selected', 'dark']:
|
||||||
if filename.endswith(candidate + '.icns'):
|
if filename.endswith(candidate + '.icns'):
|
||||||
desc = candidate
|
desc = candidate
|
||||||
|
break
|
||||||
|
|
||||||
choices = []
|
choices = []
|
||||||
for x in _TYPES.values():
|
for x in _TYPES.values():
|
||||||
|
|||||||
Reference in New Issue
Block a user