Simpler configuration check allows not-installed to be caught earlier.
Issue #138
This commit is contained in:
parent
b7edcd5b43
commit
425b13a7f1
1 changed files with 8 additions and 7 deletions
|
|
@ -50,20 +50,21 @@ def load_openjpeg(libopenjpeg_path):
|
||||||
# Let ctypes try to find it.
|
# Let ctypes try to find it.
|
||||||
libopenjpeg_path = find_library('openjpeg')
|
libopenjpeg_path = find_library('openjpeg')
|
||||||
|
|
||||||
# If we could not find it, then look in some likely locations.
|
# If we could not find it, then look in some likely locations on mac
|
||||||
|
# and win.
|
||||||
if libopenjpeg_path is None:
|
if libopenjpeg_path is None:
|
||||||
if platform.system() == 'Darwin':
|
if platform.system() == 'Darwin':
|
||||||
path = '/opt/local/lib/libopenjpeg.dylib'
|
if os.path.exists('/opt/local/lib/libopenjpeg.dylib'):
|
||||||
if os.path.exists(path):
|
libopenjpeg_path = '/opt/local/lib/libopenjpeg.dylib'
|
||||||
libopenjpeg_path = path
|
|
||||||
elif os.name == 'nt':
|
elif os.name == 'nt':
|
||||||
path = os.path.join('C:\\', 'Program files', 'OpenJPEG 1.5',
|
path = os.path.join('C:\\', 'Program files', 'OpenJPEG 1.5',
|
||||||
'bin', 'openjpeg.dll')
|
'bin', 'openjpeg.dll')
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
libopenjpeg_path = path
|
libopenjpeg_path = path
|
||||||
else:
|
|
||||||
# No sense trying further on Linux
|
# If still no location, then no bother going further.
|
||||||
return None
|
if libopenjpeg_path is None:
|
||||||
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if os.name == "nt":
|
if os.name == "nt":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue