housecleaning for 0.7.0 release
Add testing mention of CentOS, windows. Skipping some tests on versions 1.3 and 1.4 Minor doc mods. For whatever stupid reason, np.log2(x) cannot be relied upon to be an integer when x is a power of 2 ON WIN32!!! All hail win32! Better error message if array-style slice other than [:]
This commit is contained in:
parent
64fa597b18
commit
0e2aa4492c
15 changed files with 92 additions and 35 deletions
|
|
@ -76,9 +76,9 @@ copyright = u'2013, John Evans'
|
|||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '0.6'
|
||||
version = '0.7'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '0.6.0'
|
||||
release = '0.7.0rc1'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ configuration format is the same as used by Python’s configparser
|
|||
module, i.e. ::
|
||||
|
||||
[library]
|
||||
openjp2: /opt/openjp2-svn/lib/libopenjp2.so
|
||||
openjp2: /somewhere/lib/libopenjp2.so
|
||||
|
||||
This assumes, of course, that you've installed OpenJPEG into
|
||||
/opt/openjp2-svn on a linux system. The location of the configuration file
|
||||
can vary as well (of course). If you use either linux or mac, the path
|
||||
/opt/openjpeg on a linux system. The location of the configuration file
|
||||
can vary as well. If you use either linux or mac, the path
|
||||
to the configuration file would normally be ::
|
||||
|
||||
$HOME/.config/glymur/glymurrc
|
||||
|
|
@ -48,7 +48,7 @@ You may also include a line for the version 1.x openjpeg library if you have it
|
|||
installed in a non-standard place, i.e. ::
|
||||
|
||||
[library]
|
||||
openjpeg: /not/the/usual/location/lib/libopenjpeg.so
|
||||
openjpeg: /somewhere/lib/libopenjpeg.so
|
||||
|
||||
'''''''
|
||||
Testing
|
||||
|
|
|
|||
|
|
@ -3,14 +3,15 @@ How do I...?
|
|||
------------
|
||||
|
||||
|
||||
... read the lower resolution images?
|
||||
=====================================
|
||||
Jp2k implements slicing via the :py:meth:`__getitem__` method so
|
||||
any lower resolution images in a JPEG 2000 file can easily be
|
||||
accessed, for example here's how to retrieve the first sub-image ::
|
||||
... read images?
|
||||
================
|
||||
Jp2k implements slicing via the :py:meth:`__getitem__` method, meaning that
|
||||
multiple resolution imagery in a JPEG 2000 file can
|
||||
easily be accessed via array-style slicing. For example here's how to
|
||||
retrieve a full resolution and first lower-resolution image ::
|
||||
|
||||
>>> import glymur
|
||||
>>> jp2file = glymur.data.nemo()
|
||||
>>> jp2file = glymur.data.nemo() # just a path to a JPEG2000 file
|
||||
>>> jp2 = glymur.Jp2k(jp2file)
|
||||
>>> fullres = jp2[:]
|
||||
>>> print(fullres.shape)
|
||||
|
|
@ -19,20 +20,34 @@ accessed, for example here's how to retrieve the first sub-image ::
|
|||
>>> print(thumbnail.shape)
|
||||
(728, 1296, 3)
|
||||
|
||||
The :py:meth:`read` method gives many more options for other JPEG 2000 features
|
||||
such as quality layers.
|
||||
The :py:meth:`read` method exposes many more options for other JPEG 2000
|
||||
features such as quality layers.
|
||||
|
||||
... write images?
|
||||
=================
|
||||
So long as the image data can fit entirely into memory, array-style slicing may
|
||||
also be used to write JPEG 2000 files.
|
||||
|
||||
>>> import glymur, numpy as np
|
||||
>>> jp2 = glymur.Jp2k('zeros.jp2', mode='wb')
|
||||
>>> jp2[:] = np.zeros((640, 480), dtype=np.uint8)
|
||||
|
||||
The :py:meth:`write` method exposes many more options for other JPEG 2000
|
||||
features. You should have OpenJPEG version 1.5 or more recent before writing
|
||||
JPEG 2000 images.
|
||||
|
||||
... display metadata?
|
||||
=====================
|
||||
There are two ways. From the command line, the script **jp2dump** is
|
||||
There are two ways. From the command line, the console script **jp2dump** is
|
||||
available. ::
|
||||
|
||||
$ jp2dump /path/to/glymur/installation/data/nemo.jp2
|
||||
|
||||
From within Python, it is as simple as printing the Jp2k object, i.e. ::
|
||||
From within Python, the same result is obtained simply by printing the Jp2k
|
||||
object, i.e. ::
|
||||
|
||||
>>> import glymur
|
||||
>>> jp2file = glymur.data.nemo()
|
||||
>>> jp2file = glymur.data.nemo() # just a path to a JP2 file
|
||||
>>> jp2 = glymur.Jp2k(jp2file)
|
||||
>>> print(jp2)
|
||||
File: nemo.jp2
|
||||
|
|
@ -326,10 +341,10 @@ is currently limited to XML and UUID boxes.
|
|||
... create an image with an alpha layer?
|
||||
========================================
|
||||
|
||||
OpenJPEG can create JP2 files with more than 3 components (requires
|
||||
the development version of OpenJPEG), but by default, any extra components are
|
||||
not described as such. In order to do so, we need to rewrap such
|
||||
an image in a set of boxes that includes a channel definition box.
|
||||
OpenJPEG can create JP2 files with more than 3 components (use version 2.1.0+
|
||||
for this), but by default, any extra components are not described
|
||||
as such. In order to do so, we need to rewrap such an image in a
|
||||
set of boxes that includes a channel definition box.
|
||||
|
||||
This example is based on SciPy example code found at
|
||||
http://scipy-lectures.github.io/advanced/image_processing/#basic-manipulations .
|
||||
|
|
@ -387,7 +402,11 @@ Here's how the Preview application on the mac shows the RGBA image.
|
|||
|
||||
... work with XMP UUIDs?
|
||||
========================
|
||||
XMP is metadata on steroids.
|
||||
`Wikipedia <http://en.wikipedia.org/wiki/Extensible_Metadata_Platform>`_ states
|
||||
that "The Extensible Metadata Platform (XMP) is an ISO standard,
|
||||
originally created by Adobe Systems Inc., for the creation, processing
|
||||
and interchange of standardized and custom metadata for all kinds
|
||||
of resources."
|
||||
|
||||
The example JP2 file shipped with glymur has an XMP UUID. ::
|
||||
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ Contents:
|
|||
introduction
|
||||
detailed_installation
|
||||
how_do_i
|
||||
api
|
||||
whatsnew/index
|
||||
roadmap
|
||||
api
|
||||
|
||||
------------------
|
||||
Indices and tables
|
||||
|
|
|
|||
|
|
@ -5,13 +5,16 @@ Glymur: a Python interface for JPEG 2000
|
|||
**Glymur** is an interface to the OpenJPEG library
|
||||
which allows one to read and write JPEG 2000 files from Python.
|
||||
Glymur supports both reading and writing of JPEG 2000 images, but writing
|
||||
JPEG 2000 images is currently limited to images that can fit in memory
|
||||
JPEG 2000 images is currently limited to images that can fit in memory.
|
||||
**Glymur** can read images using OpenJPEG library versions as far back as 1.3,
|
||||
but it is strongly recommended to use version 2.1.0, which is the most recently
|
||||
released version of OpenJPEG at this time.
|
||||
|
||||
In regards to metadata, most JP2 boxes are properly interpreted.
|
||||
Certain optional JP2 boxes can also be written, including XML boxes and
|
||||
XMP UUIDs. There is incomplete support for reading JPX metadata.
|
||||
|
||||
Glymur 0.6 works on Python versions 2.7, 3.3 and 3.4. If you have Python 2.6,
|
||||
Glymur works on Python versions 2.7, 3.3 and 3.4. If you have Python 2.6,
|
||||
you should use the 0.5 series of Glymur.
|
||||
|
||||
For more information about OpenJPEG, please consult http://www.openjpeg.org.
|
||||
|
|
@ -27,5 +30,6 @@ but you should also be able to install Glymur via pip ::
|
|||
|
||||
$ pip install glymur
|
||||
|
||||
In addition to the package, this also gives you a script **jp2dump** that can
|
||||
be used from the command line line to print JPEG 2000 metadata.
|
||||
In addition to the package, this also gives you a command line script
|
||||
**jp2dump** that can be used from the command line line to print JPEG 2000
|
||||
metadata.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,12 @@
|
|||
-------------------------------------
|
||||
Platforms Tested (0.7.0 release only)
|
||||
-------------------------------------
|
||||
* Linux Mint 17 / Python 3.4.0 and 2.7.6 / OpenJPEG 2.1.0 and 1.3.0
|
||||
* MacOS 10.6.8 / MacPorts Python 3.4.1, 3.3.5,and 2.7.8 / OpenJPEG 2.1.0
|
||||
* CentOS 6.5 / Anaconda Python 3.4.1 / OpenJPEG 1.3.0
|
||||
* Fedora 20 i386 / Python 2.7.5 and 3.3.2 / OpenJPEG 1.5.1
|
||||
* Windows 7 32bit / Anaconda Python 2.7.6 and 3.4.1 / OpenJPEG 2.1.0
|
||||
|
||||
------------
|
||||
Known Issues
|
||||
------------
|
||||
|
|
|
|||
11
docs/source/whatsnew/0.7.rst
Normal file
11
docs/source/whatsnew/0.7.rst
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
=====================
|
||||
Changes in glymur 0.7
|
||||
=====================
|
||||
|
||||
Changes in 0.7.0
|
||||
=================
|
||||
|
||||
* implemented :py:meth:`__getitem__`, :py:meth:`__setitem__` support
|
||||
* added back windows support
|
||||
* box_id and longname are class attributes now instead of instance
|
||||
attributes (see issue 248)
|
||||
|
|
@ -10,3 +10,4 @@ These document the changes between minor (or major) versions of glymur.
|
|||
|
||||
0.5
|
||||
0.6
|
||||
0.7
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue