From 1d23ffcfbf5e68102bb651ab450a6443479e9c87 Mon Sep 17 00:00:00 2001 From: John Evans Date: Thu, 25 Jul 2013 15:27:53 -0400 Subject: [PATCH] Not trying to running opj_version upon import anymore when no library. This should allow us to warn but not error out when neither library is present. We should be able to retrieve metadata on such configurations. --- glymur/lib/openjpeg.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/glymur/lib/openjpeg.py b/glymur/lib/openjpeg.py index 3dd0592..4f990df 100644 --- a/glymur/lib/openjpeg.py +++ b/glymur/lib/openjpeg.py @@ -23,7 +23,12 @@ def version(): # Need to get the minor version, make sure we are at least at 1.4.x #import pdb; pdb.set_trace() -_MINOR = version().split('.')[1] +if OPENJPEG is not None: + _MINOR = version().split('.')[1] +else: + # Does not really matter. But version should not be called if there is no + # OpenJPEG library found. + _MINOR = 0 class EventMgrType(ctypes.Structure):