pep8 work, #67

This commit is contained in:
John Evans 2013-07-05 16:46:05 -04:00
commit 32dcb12823

View file

@ -635,7 +635,6 @@ class Jp2k(Jp2kBox):
src = fp.read() src = fp.read()
cio = opj._cio_open(dinfo, src) cio = opj._cio_open(dinfo, src)
image = opj._decode(dinfo, cio) image = opj._decode(dinfo, cio)
stack.callback(opj._image_destroy, image) stack.callback(opj._image_destroy, image)
@ -680,7 +679,8 @@ class Jp2k(Jp2kBox):
addr = ctypes.addressof(component.data.contents) addr = ctypes.addressof(component.data.contents)
with warnings.catch_warnings(): with warnings.catch_warnings():
warnings.simplefilter("ignore") warnings.simplefilter("ignore")
x = np.ctypeslib.as_array( (ctypes.c_int32 * nrows * ncols).from_address(addr)) nelts = nrows * ncols
x = np.ctypeslib.as_array((ctypes.c_int32 * nelts).from_address(addr))
data[:, :, k] = np.reshape(x.astype(dtype), (nrows, ncols)) data[:, :, k] = np.reshape(x.astype(dtype), (nrows, ncols))
if data.shape[2] == 1: if data.shape[2] == 1: