def decode_jxr(data): """Decode JXR data stream into ndarray via temporary file.""" fd, filename = tempfile.mkstemp(suffix='.jxr') with os.fdopen(fd, 'wb') as fh: fh.write(data) if isinstance(filename, unicode): filename = filename.encode('ascii') try: out = _czifile.decode_jxr(filename) finally: os.remove(filename) return out
def decode_jxr(data): """Decode JXR data stream into ndarray.""" return _czifile.decode_jxr(data)