Skip to content

Commit

Permalink
Merge pull request #4373 from radarhere/display_profile
Browse files Browse the repository at this point in the history
get_display_profile is only supported on Windows
  • Loading branch information
radarhere committed Feb 16, 2020
2 parents a89156a + b0b3097 commit 29fee8f
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/PIL/ImageCms.py
Expand Up @@ -254,20 +254,15 @@ def get_display_profile(handle=None):
:returns: None if the profile is not known.
"""

if sys.platform == "win32":
from PIL import ImageWin
if sys.platform != "win32":
return None

if isinstance(handle, ImageWin.HDC):
profile = core.get_display_profile_win32(handle, 1)
else:
profile = core.get_display_profile_win32(handle or 0)
from PIL import ImageWin

if isinstance(handle, ImageWin.HDC):
profile = core.get_display_profile_win32(handle, 1)
else:
try:
get = _imagingcms.get_display_profile
except AttributeError:
return None
else:
profile = get()
profile = core.get_display_profile_win32(handle or 0)
return ImageCmsProfile(profile)


Expand Down

0 comments on commit 29fee8f

Please sign in to comment.