mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Merge pull request #4373 from radarhere/display_profile
get_display_profile is only supported on Windows
This commit is contained in:
commit
29fee8fc43
|
@ -254,20 +254,15 @@ def get_display_profile(handle=None):
|
||||||
:returns: None if the profile is not known.
|
:returns: None if the profile is not known.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if sys.platform == "win32":
|
if sys.platform != "win32":
|
||||||
from PIL import ImageWin
|
return None
|
||||||
|
|
||||||
if isinstance(handle, ImageWin.HDC):
|
from PIL import ImageWin
|
||||||
profile = core.get_display_profile_win32(handle, 1)
|
|
||||||
else:
|
if isinstance(handle, ImageWin.HDC):
|
||||||
profile = core.get_display_profile_win32(handle or 0)
|
profile = core.get_display_profile_win32(handle, 1)
|
||||||
else:
|
else:
|
||||||
try:
|
profile = core.get_display_profile_win32(handle or 0)
|
||||||
get = _imagingcms.get_display_profile
|
|
||||||
except AttributeError:
|
|
||||||
return None
|
|
||||||
else:
|
|
||||||
profile = get()
|
|
||||||
return ImageCmsProfile(profile)
|
return ImageCmsProfile(profile)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user