Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot load local setting #384

Closed
enokoneko opened this issue Jul 4, 2024 · 5 comments · Fixed by #425
Closed

Cannot load local setting #384

enokoneko opened this issue Jul 4, 2024 · 5 comments · Fixed by #425

Comments

@enokoneko
Copy link

Describe the bug
UI worked but cannot load local setting.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'File > load settings'
  2. Click on '/Library/ColorSync/Profiles/Displays/xxx.icc'
  3. See error
cannot access local variable 'cal' where it is not associated with a value

Traceback (most recent call last):
File "/Users/xxx/displaycal-py3/.venv/lib/python3.12/site-packages/wx/core.py", line 3427, in <lambda>
lambda event: event.callable(*event.args, **event.kw) )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/displaycal-py3/.venv/lib/python3.12/site-packages/DisplayCAL/wxaddons.py", line 852, in process
self.drophandlers[ext](filename)
File "/Users/xxx/displaycal-py3/.venv/lib/python3.12/site-packages/DisplayCAL/display_cal.py", line 2349, in cal_drop_handler
self.load_cal_handler(None, path)
File "/Users/xxx/displaycal-py3/.venv/lib/python3.12/site-packages/DisplayCAL/display_cal.py", line 17741, in load_cal_handler
ti3_lines = [line.strip() for line in cal]
^^^
UnboundLocalError: cannot access local variable 'cal' where it is not associated with a value

Expected behavior
Load the setting so I can modify the icc profile manually and save it. Because I don't have an instrument.

Versions (please complete the following information):

  • macOS 14.5
  • Python 3.12.4
  • ArgyllCMS 3.2.0
  • DisplayCAL 3.9.12
image
@p5k369
Copy link
Collaborator

p5k369 commented Aug 13, 2024

Hey @enokoneko are you sure you have permission to read the file you are trying to load? And if so, can you please provide that file?

@Headcrabed
Copy link

Hi @eoyilmaz I also met this problem. I tried ref icc file come with argyllcms and also the display p3 icc from https://www.color.org/chardata/rgb/DisplayP3.xalter and have the same result. I'm using windows 11 + python 3.11.9 + pypi version of displaycal 3.9.12.

@eoyilmaz
Copy link
Owner

I'm going to release DisplayCAL 3.9.13 soon (may be today), please try it and report if the proplem still exists.

@eoyilmaz
Copy link
Owner

Okay I can reproduce this with DisplayCAL 3.9.14.dev + Python 3.13 :

Ready.
Setting up scripting host at 127.0.0.1:15411
Check for application update...
DisplayCAL is up-to-date.
ArgyllCMS is up-to-date.
NoneType: None
┌──────────────────────────────────────────────────────────────────────────────┐
│ Traceback (most recent call last):                                           │
│   File                                                                       │
│ "/Users/eoyilmaz/Documents/development/displaycal-py3/DisplayCAL/display_cal.py", │
│ line 17777, in load_cal_handler                                              │
│     ti3_lines = [line.strip() for line in cal]                               │
│                                           ^^^                                │
│ UnboundLocalError: cannot access local variable 'cal' where it is not        │
│ associated with a value                                                      │
└──────────────────────────────────────────────────────────────────────────────┘
NoneType: None
┌──────────────────────────────────────────────────────────────────────────────┐
│ Traceback (most recent call last):                                           │
│   File                                                                       │
│ "/Users/eoyilmaz/Documents/development/displaycal-py3/DisplayCAL/display_cal.py", │
│ line 17777, in load_cal_handler                                              │
│     ti3_lines = [line.strip() for line in cal]                               │
│                                           ^^^                                │
│ UnboundLocalError: cannot access local variable 'cal' where it is not        │
│ associated with a value                                                      │
└──────────────────────────────────────────────────────────────────────────────┘

@eoyilmaz
Copy link
Owner

Okay so, from what I understand from the code, this feature is only supported for profiles that are generated with ArgyllCMS and it requires to contain a targ tag with proper data.

I updated the code so it will inform the user if the ICC profile is not supported:

image

eoyilmaz added a commit that referenced this issue Oct 15, 2024
…to let the user know if the selected ICC profile doesn't contain a `targ` tag and not suitable for loading data from. Also updated language files for a suitable error message.
eoyilmaz added a commit that referenced this issue Oct 15, 2024
[#384] Updated `DisplayCAL.display_cal.MainFrame.load_cal_handler()` …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants