Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit98e8fd5

Browse files
committed
set QT_QPA_FONTDIR
1 parent3e41ac2 commit98e8fd5

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

‎cv2/__init__.py‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,25 @@
99
# this makes them available
1010
globals().update(importlib.import_module("cv2.cv2").__dict__)
1111

12-
is_ci_build=False
12+
ci_and_not_headless=False
1313

1414
try:
15-
from .versionimportci_build
16-
is_ci_build=ci_build
15+
from .versionimportci_build,headless
16+
17+
ci_and_not_headless=ci_buildandnotheadless
1718
except:
1819
pass
1920

2021
# the Qt plugin is included currently only in the pre-built wheels
21-
if (sys.platform=="darwin"orsys.platform.startswith("linux"))andis_ci_build:
22+
if (
23+
sys.platform=="darwin"orsys.platform.startswith("linux")
24+
)andci_and_not_headless:
2225
os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"]=os.path.join(
2326
os.path.dirname(os.path.abspath(__file__)),"qt","plugins"
2427
)
28+
29+
# Qt will throw warning on Linux if fonts are not found
30+
ifsys.platform.startswith("linux")andci_and_not_headless:
31+
os.environ["QT_QPA_FONTDIR"]=os.path.join(
32+
os.path.dirname(os.path.abspath(__file__)),"qt","fonts"
33+
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp