From 9a77cfac9704e24eab5499a3204760ba7bd32072 Mon Sep 17 00:00:00 2001 From: John Evans Date: Mon, 27 May 2013 07:19:27 -0400 Subject: [PATCH] Fixed write example so as to not rely on matplotlib. --- CHANGES.txt | 1 + glymur/jp2k.py | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index e69de29..6d2a22e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -0,0 +1 @@ +May 27, 2013 - Changed write example to not rely on matplotlib. diff --git a/glymur/jp2k.py b/glymur/jp2k.py index cbd8be5..dbfc74d 100644 --- a/glymur/jp2k.py +++ b/glymur/jp2k.py @@ -194,16 +194,13 @@ class Jp2k(Jp2kBox): Examples -------- - >>> import numpy as np - >>> import matplotlib as mpl - >>> import matplotlib.pyplot as plt - >>> import os - >>> file = os.path.join(mpl.get_data_path(), 'sample_data', 'lena.png') - >>> data = plt.imread(file) - >>> data = data * 255 + >>> import glymur + >>> import pkg_resources as pkg + >>> jfile = pkg.resource_filename(glymur.__name__, "data/nemo.jp2") + >>> jp2 = glymur.Jp2k(jfile) + >>> data = jp2.read(reduce=3) >>> from tempfile import NamedTemporaryFile >>> tfile = NamedTemporaryFile(suffix='.jp2', delete=False) - >>> from glymur import Jp2k >>> j = Jp2k(tfile.name, mode='wb') >>> j.write(data.astype(np.uint8)) """