From d5e9d8fcb6d68e6dfe7442486d216871b2b73bfc Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 17 May 2026 01:11:04 -0700 Subject: [PATCH] Fix .ico extension check in GroupIcon.export() This was comparing the filename with the extension removed to ".ico" instead of the extension. --- nefile/resources/icon.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nefile/resources/icon.py b/nefile/resources/icon.py index 0b89377..23247df 100644 --- a/nefile/resources/icon.py +++ b/nefile/resources/icon.py @@ -29,8 +29,7 @@ def __init__(self, stream, resource_declaration, resource_table): ## An ICO extension will be added if it isn't already present. def export(self, export_filepath): ICO_FILENAME_EXTENSION = '.ico' - filename_extension_present = (export_filepath[:-4].lower() == ICO_FILENAME_EXTENSION) - if not filename_extension_present: + if not export_filepath.lower().endswith(ICO_FILENAME_EXTENSION): export_filepath += ICO_FILENAME_EXTENSION # CALCULATE THE IMAGE OFFSETS.