From 2708c78f8eddad71e30907f32515c202e1130a08 Mon Sep 17 00:00:00 2001 From: tyler Date: Sun, 28 Jun 2026 13:31:50 -0700 Subject: [PATCH] fix for packed images --- src/analysis/participantfoldchannels.py | 6 +++--- src/shared/shareddata.py | 2 +- src/window/welcome.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/analysis/participantfoldchannels.py b/src/analysis/participantfoldchannels.py index 790e221..331cd38 100644 --- a/src/analysis/participantfoldchannels.py +++ b/src/analysis/participantfoldchannels.py @@ -517,7 +517,7 @@ class InteractiveParticipantGridCanvas(FigureCanvas): layout = QVBoxLayout(popup) layout.setContentsMargins(0, 0, 0, 0) # Strip extra outer layout spacing - target_png_path = resource_path("../../images/brain.png") + target_png_path = resource_path("images/brain.png") expanded_canvas = StaticChannelCanvas( channel_name, @@ -572,7 +572,7 @@ class InteractiveParticipantGridCanvas(FigureCanvas): header.setAlignment(Qt.AlignmentFlag.AlignCenter) card_layout.addWidget(header) - target_png_path = resource_path("../../images/brain.png") + target_png_path = resource_path("images/brain.png") # 3. Instantiate the canvas with a custom size flag or constraint # Adjust your StaticChannelCanvas __init__ to check if it should render in 'compact' mode @@ -688,7 +688,7 @@ class InteractiveParticipantGridCanvas(FigureCanvas): layout = QVBoxLayout(popup) layout.setContentsMargins(10, 10, 10, 10) - target_png_path = resource_path("../../images/brain.png") + target_png_path = resource_path("images/brain.png") # This one renders full size (900x520) for analytical reading expanded_canvas = StaticChannelCanvas( diff --git a/src/shared/shareddata.py b/src/shared/shareddata.py index 4a05aac..be12859 100644 --- a/src/shared/shareddata.py +++ b/src/shared/shareddata.py @@ -58,6 +58,6 @@ def resource_path(relative_path): # PyInstaller bundle path base_path = sys._MEIPASS else: - base_path = os.path.dirname(os.path.abspath(__file__)) + base_path = os.path.abspath(".") return os.path.join(base_path, relative_path) \ No newline at end of file diff --git a/src/window/welcome.py b/src/window/welcome.py index 423502c..8f770a9 100644 --- a/src/window/welcome.py +++ b/src/window/welcome.py @@ -27,7 +27,7 @@ class WelcomeDialog(QDialog): logo_label = QLabel(self) # NOTE: might not work on mac and need the icns file - logo_label.setPixmap(QIcon(resource_path("../../icons/main.ico")).pixmap(48, 48)) + logo_label.setPixmap(QIcon(resource_path("icons/main.ico")).pixmap(48, 48)) if first: title_label = QLabel(f"

Welcome to {APP_NAME.upper()}!

", self) elif direct: