Minor tweaks.
This commit is contained in:
parent
7d816ffb21
commit
c65ae274a9
4 changed files with 20 additions and 28 deletions
|
|
@ -7,8 +7,8 @@ Most users won't need to read this! You've been warned...
|
|||
Glymur Configuration
|
||||
''''''''''''''''''''''
|
||||
|
||||
The default glymur installation process relies upon OpenJPEG version
|
||||
1.X being properly installed on your system. If you have version 1.5 you can
|
||||
The default glymur installation process relies upon OpenJPEG
|
||||
being properly installed on your system. If you have version 1.5 you can
|
||||
both read and write JPEG 2000 files, but you may wish to install version 2.0
|
||||
or the 2.0+ version from OpenJPEG's development trunk for better performance.
|
||||
If you do that, you should compile it as a shared library (named *openjp2*
|
||||
|
|
@ -35,7 +35,7 @@ i.e. ::
|
|||
|
||||
This assumes, of course, that you've installed OpenJPEG into
|
||||
/opt/openjp2-svn on a linux system. The location of the configuration file
|
||||
is platform-dependent (of course). If you use either linux or mac, the path
|
||||
can vary as well (of course). If you use either linux or mac, the path
|
||||
to the configuration file would normally be ::
|
||||
|
||||
$HOME/.config/glymur/glymurrc
|
||||
|
|
@ -71,7 +71,8 @@ packages/RPMs/ports/whatever without going through pip.
|
|||
Mac OS X
|
||||
--------
|
||||
All the necessary packages are available to use glymur with Python 2.6, 2.7,
|
||||
and 3.3 via MacPorts. You should install the following set of ports:
|
||||
and 3.3 via MacPorts. For python 3.3, you should install the following set of
|
||||
ports:
|
||||
|
||||
* python33
|
||||
* py33-numpy
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ How do I...?
|
|||
------------
|
||||
|
||||
|
||||
read the lowest resolution thumbnail?
|
||||
... read the lowest resolution thumbnail?
|
||||
=====================================
|
||||
Printing the Jp2k object should reveal the number of resolutions (look in the
|
||||
COD segment section), but you can take a shortcut by supplying -1 as the
|
||||
|
|
@ -14,7 +14,7 @@ resolution level. ::
|
|||
>>> j = glymur.Jp2k(file)
|
||||
>>> thumbnail = j.read(rlevel=-1)
|
||||
|
||||
display metadata?
|
||||
... display metadata?
|
||||
=================
|
||||
There are two ways. From the unix command line, the script *jp2dump* is
|
||||
available. ::
|
||||
|
|
@ -34,7 +34,7 @@ codestream box, only the main header is printed. It is possible to print
|
|||
|
||||
>>> print(j.get_codestream())
|
||||
|
||||
add XML metadata?
|
||||
... add XML metadata?
|
||||
=================
|
||||
You can append any number of XML boxes to a JP2 file (not to a raw codestream).
|
||||
Consider the following XML file `data.xml` : ::
|
||||
|
|
@ -66,7 +66,7 @@ The **append** method can add an XML box as shown below::
|
|||
>>> jp2.append(xmlbox)
|
||||
>>> print(jp2)
|
||||
|
||||
add metadata in a more general fashion?
|
||||
... add metadata in a more general fashion?
|
||||
=======================================
|
||||
An existing raw codestream (or JP2 file) can be wrapped (re-wrapped) in a
|
||||
user-defined set of JP2 boxes. To get just a minimal JP2 jacket on the
|
||||
|
|
@ -157,18 +157,18 @@ to add metadata, you should keep in mind that **wrap** produces a new JP2 file,
|
|||
while **append** modifies an existing file and is currently limited to XML
|
||||
boxes.
|
||||
|
||||
create an image with an alpha layer?
|
||||
... create an image with an alpha layer?
|
||||
====================================
|
||||
|
||||
OpenJPEG can create JP2 files with more than 3 components (requires
|
||||
the development version), but by default, any extra components are
|
||||
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.
|
||||
|
||||
This example is based on SciPy example code found at
|
||||
http://scipy-lectures.github.io/advanced/image_processing/#basic-manipulations .
|
||||
Instead of a circular mask, however, we'll make it an ellipse since the source
|
||||
image isn't square.
|
||||
Instead of a circular mask we'll make it an ellipse since the source
|
||||
image isn't square. ::
|
||||
|
||||
>>> import numpy as np
|
||||
>>> import glymur
|
||||
|
|
|
|||
|
|
@ -4,9 +4,8 @@ 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 within Python.
|
||||
Glymur supports both reading and writing of JPEG 2000 images. Writing
|
||||
JPEG 2000 images is currently limited to images that can fit in memory,
|
||||
however.
|
||||
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
|
||||
|
||||
Of particular focus is retrieval of metadata. Reading Exif UUIDs is supported,
|
||||
as is reading XMP UUIDs as the XMP data packet is just XML. There is
|
||||
|
|
@ -24,11 +23,10 @@ only supported with the 1.5 or better, however, and the trunk/development
|
|||
version is strongly recommended. For more information about OpenJPEG,
|
||||
please consult http://www.openjpeg.org.
|
||||
|
||||
If you use MacPorts on the mac or if you have a sufficiently recent
|
||||
version of Linux, your package manager should already provide you
|
||||
with a version of OpenJPEG 1.X with which glymur can already use
|
||||
for read-only purposes. If your platform is windows, I suggest
|
||||
using the windows installers provided to you by the OpenJPEG
|
||||
If you use MacPorts or if you have a sufficiently recent version of
|
||||
Linux, your package manager should already provide you with a version of
|
||||
OpenJPEG 1.X which glymur can already use. If your platform is windows,
|
||||
I suggest using the windows installers provided to you by the OpenJPEG
|
||||
folks at https://code.google.com/p/openjpeg/downloads/list .
|
||||
|
||||
Glymur Installation
|
||||
|
|
@ -47,13 +45,5 @@ line, so you should adjust your **$PATH**
|
|||
to take advantage of it. For example, if you install with pip's
|
||||
`--user` option on linux ::
|
||||
|
||||
$ export PYTHONPATH=$HOME/.local/lib/python3.3/site-packages
|
||||
$ export PATH=$HOME/.local/bin:$PATH
|
||||
|
||||
You can run the tests from within python as follows::
|
||||
|
||||
>>> import glymur
|
||||
>>> glymur.runtests()
|
||||
|
||||
Many tests are currently skipped, but the The important thing is whether or
|
||||
not any tests fail.
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#
|
||||
# License: MIT
|
||||
|
||||
import pdb; pdb.set_trace()
|
||||
import sys
|
||||
import numpy as np
|
||||
from distutils.version import LooseVersion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue