Debian Codegraph @

util/find_colorspace_profiles.py

raw
1 #!/usr/bin/env python3
2 import os
3 import sys
4
5 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
6
7 from DisplayCAL import ICCProfile as iccp
8 from DisplayCAL.defaultpaths import ICCPROFILES, ICCPROFILES_HOME
9
10
11 for p in set(ICCPROFILES_HOME + ICCPROFILES):
12 if os.path.isdir(p):
13 for f in os.listdir(p):
14 try:
15 profile = iccp.ICCProfile(os.path.join(p, f))
16 except Exception:
17 pass
18 else:
19 if profile.profileClass == b"spac":
20 print(f)
21 print("ICC Version:", profile.version)
22 print("Color space:", profile.colorSpace)
23 print("Connection color space:", profile.connectionColorSpace)
24 print("")