From da6f109f38ea6cee586ba97da3f30ec99ed396db Mon Sep 17 00:00:00 2001 From: DDWMV Date: Thu, 9 Jul 2026 02:05:49 +0000 Subject: [PATCH 1/8] Potential fix for code scanning alert no. 13: Unused local variable Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- wimf/viewer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wimf/viewer.py b/wimf/viewer.py index 091c2de..3010909 100644 --- a/wimf/viewer.py +++ b/wimf/viewer.py @@ -177,7 +177,7 @@ def main(): if os.path.exists(p): root = tk.Tk() - viewer = WIMFViewer(root, p) + WIMFViewer(root, p) root.mainloop() else: print(f"File not found: {p}") From dd42a6e5ce24acda9bec80dbbe1b14b922dd47c0 Mon Sep 17 00:00:00 2001 From: DDWMV Date: Thu, 9 Jul 2026 02:08:34 +0000 Subject: [PATCH 2/8] Potential fix for code scanning alert no. 9: Unused import Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- wimf/test_core.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/wimf/test_core.py b/wimf/test_core.py index 7eb84a6..2ee2cb6 100644 --- a/wimf/test_core.py +++ b/wimf/test_core.py @@ -1,5 +1,3 @@ -import os - import numpy as np from PIL import Image From 7646f5a259e899e05fc9c4abf762b23b1353bf82 Mon Sep 17 00:00:00 2001 From: DDWMV Date: Thu, 9 Jul 2026 02:10:09 +0000 Subject: [PATCH 3/8] Potential fix for code scanning alert no. 8: Module imports itself Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- wimf/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wimf/__init__.py b/wimf/__init__.py index dda4e80..226f9a8 100644 --- a/wimf/__init__.py +++ b/wimf/__init__.py @@ -47,9 +47,9 @@ def save(path, image, **kwargs): raw = encoder.encode(**encode_args) try: - from . import wimf_cpp + from .wimf_cpp import c_save_file - wimf_cpp.c_save_file(path, raw) + c_save_file(path, raw) except (ImportError, AttributeError): with _builtins.open(path, "wb") as f: f.write(raw) From 89c6114d7c765c632adeff9e93182841a5d4cbea Mon Sep 17 00:00:00 2001 From: DDWMV Date: Thu, 9 Jul 2026 02:16:45 +0000 Subject: [PATCH 4/8] Potential fix for code scanning alert no. 6: Module is imported with 'import' and 'import from' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- wimf/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wimf/cli.py b/wimf/cli.py index 4283c2c..14c3f5a 100644 --- a/wimf/cli.py +++ b/wimf/cli.py @@ -12,7 +12,7 @@ import numpy as np from PIL import ExifTags, Image, ImageSequence -from wimf.io import loadImage, saveImage +import wimf.io logger = logging.getLogger(__name__) From 25bc3f939f9e5aed889e81251176c77a68041675 Mon Sep 17 00:00:00 2001 From: DDWMV Date: Thu, 9 Jul 2026 02:23:35 +0000 Subject: [PATCH 5/8] Potential fix for code scanning alert no. 1: Except block handles 'BaseException' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- wimf/cat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wimf/cat.py b/wimf/cat.py index c7e9b25..f368e7c 100644 --- a/wimf/cat.py +++ b/wimf/cat.py @@ -14,7 +14,7 @@ def render_terminal(wimf_img, width=None): if width is None: try: width = os.get_terminal_size().columns - except: + except OSError: width = 80 # Account for terminal character aspect ratio (~2:1) From bde7afed0d20f30facba59113f1fd30f671471fe Mon Sep 17 00:00:00 2001 From: DDWMV Date: Thu, 9 Jul 2026 02:25:29 +0000 Subject: [PATCH 6/8] Potential fix for code scanning alert no. 4: Empty except Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- wimf/codec.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wimf/codec.py b/wimf/codec.py index 9d55846..fc72c14 100644 --- a/wimf/codec.py +++ b/wimf/codec.py @@ -8,8 +8,9 @@ try: from . import wimf_cpp # type: ignore[attr-defined] -except ImportError: - pass +except ImportError as exc: + # Optional C++ acceleration module is unavailable; fall back to Python implementation. + logger.debug("wimf_cpp extension not available, using Python codec path: %s", exc) import multiprocessing from concurrent.futures import ThreadPoolExecutor From 14e848ec8a1995d746ff65a1520bda3091e68d88 Mon Sep 17 00:00:00 2001 From: DDWMV Date: Thu, 9 Jul 2026 02:26:15 +0000 Subject: [PATCH 7/8] Potential fix for code scanning alert no. 3: Empty except Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- wimf/animation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wimf/animation.py b/wimf/animation.py index 2536c0f..5c8d354 100644 --- a/wimf/animation.py +++ b/wimf/animation.py @@ -10,7 +10,9 @@ try: from . import wimf_cpp # type: ignore[attr-defined] except ImportError: - pass + logging.getLogger(__name__).debug( + "Optional module '.wimf_cpp' could not be imported; using Python implementation." + ) logger = logging.getLogger(__name__) From 342b1de52780384c7b0b274bdb6a05fdfae170ca Mon Sep 17 00:00:00 2001 From: arrow <130365147+merkalev@users.noreply.github.com> Date: Fri, 10 Jul 2026 14:34:11 +0700 Subject: [PATCH 8/8] Potential fix for pull request finding 'Unused import' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- wimf/cli.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/wimf/cli.py b/wimf/cli.py index 14c3f5a..e6ef55a 100644 --- a/wimf/cli.py +++ b/wimf/cli.py @@ -12,8 +12,6 @@ import numpy as np from PIL import ExifTags, Image, ImageSequence -import wimf.io - logger = logging.getLogger(__name__)