Debian Codegraph @

doc/userManual.html

raw
1 ---
2 layout: page
3 title: User Manual
4 ---
5 {% include JB/setup %}
6
7
8 <header id="title-block-header">
9 <h1 class="title">Jpylyzer User Manual</h1>
10 <p class="author"/>
11 </header>
12
13
14 <nav id="TOC" role="doc-toc">
15 <ul>
16 <li><a href="#introduction">Introduction</a>
17 <ul>
18 <li><a href="#about-jpylyzer">About jpylyzer</a></li>
19 <li><a href="#validation-scope-and-restrictions">Validation: scope and restrictions</a></li>
20 <li><a href="#outline">Outline of this User Manual</a></li>
21 <li><a href="#funding">Funding</a></li>
22 <li><a href="#license">License</a></li>
23 </ul></li>
24 <li><a href="#installation">Installation and set-up</a>
25 <ul>
26 <li><a href="#obtaining-the-software">Obtaining the software</a></li>
27 <li><a href="#installation-pip">Installation with Pip (Linux/Unix, Windows, Mac OS X)</a></li>
28 <li><a href="#installation-windows">Installation of Windows binaries (Windows only)</a></li>
29 <li><a href="#installation-debian">Installation of Debian packages (Ubuntu/Linux)</a></li>
30 </ul></li>
31 <li><a href="#using-jpylyzer">Using <em>jpylyzer</em></a>
32 <ul>
33 <li><a href="#using-overview">Overview</a></li>
34 <li><a href="#command-line-usage">Command-line usage</a></li>
35 <li><a href="#using-as-python-module">Using <em>jpylyzer</em> as a Python module</a></li>
36 <li><a href="#java-integration">Java integration</a></li>
37 </ul></li>
38 <li><a href="#structure-jp2">Structure of a JP2 file</a>
39 <ul>
40 <li><a href="#structure-scope">Scope of this section</a></li>
41 <li><a href="#general-format-structure">General format structure</a></li>
42 <li><a href="#general-box-structure">General structure of a box</a></li>
43 <li><a href="#defined-boxes">Defined boxes in JP2</a></li>
44 </ul></li>
45 <li><a href="#output-format">Output format</a>
46 <ul>
47 <li><a href="#output-format-overview">Overview</a></li>
48 <li><a href="#toolinfo-element">toolInfo element</a></li>
49 <li><a href="#file-element">file element</a></li>
50 <li><a href="#fileinfo-element">fileInfo element</a></li>
51 <li><a href="#statusinfo-element">statusInfo element</a></li>
52 <li><a href="#isvalid-element">isValid element</a></li>
53 <li><a href="#tests-element">tests element</a></li>
54 <li><a href="#properties-element">properties element</a></li>
55 <li><a href="#propertiesExtension-element">propertiesExtension element</a></li>
56 </ul></li>
57 <li><a href="#jp2-box-by-box">JP2: box by box</a>
58 <ul>
59 <li><a href="#about-properties-tests-trees">About the properties and tests trees</a></li>
60 <li><a href="#jpeg2000-signature-box">JPEG 2000 Signature box</a></li>
61 <li><a href="#file-type-box">File Type box</a></li>
62 <li><a href="#jp2-header-box">JP2 Header box (superbox)</a></li>
63 <li><a href="#image-header-box">Image Header box (child of JP2 Header box)</a></li>
64 <li><a href="#bits-per-component-box">Bits Per Component box (child of JP2 Header box)</a></li>
65 <li><a href="#colour-specification-box">Colour Specification box (child of JP2 Header box)</a></li>
66 <li><a href="#palette-box">Palette box (child of JP2 Header box)</a></li>
67 <li><a href="#component-mapping-box">Component Mapping box (child of JP2 Header box)</a></li>
68 <li><a href="#channel-definition-box">Channel Definition box (child of JP2 Header box)</a></li>
69 <li><a href="#resolution-box">Resolution box (child of JP2 Header box, superbox)</a></li>
70 <li><a href="#capture-resolution-box">Capture Resolution box (child of Resolution box)</a></li>
71 <li><a href="#display-resolution-box">Default Display Resolution box (child of Resolution box)</a></li>
72 <li><a href="#codestream-box">Contiguous Codestream box</a></li>
73 <li><a href="#intellectual-property-box">Intellectual Property box</a></li>
74 <li><a href="#xml-box">XML box</a></li>
75 <li><a href="#uuid-box">UUID box</a></li>
76 <li><a href="#uuid-info-box">UUID Info box (superbox)</a></li>
77 <li><a href="#uuid-list-box">UUID List box (child of UUID Info box)</a></li>
78 <li><a href="#data-entry-url-box">Data Entry URL box (child of UUID Info box)</a></li>
79 <li><a href="#unknown-box-section">Unknown box</a></li>
80 <li><a href="#top-level-tests-properties">Top-level tests and properties</a></li>
81 </ul></li>
82 <li><a href="#contiguous-codestream-box-chapter">Contiguous Codestream box</a>
83 <ul>
84 <li><a href="#codestream-structure">General codestream structure</a></li>
85 <li><a href="#limitations-codestream-validation">Limitations of codestream validation</a></li>
86 <li><a href="#structure-reported-output">Structure of reported output</a></li>
87 <li><a href="#contiguous-codestream-box">Contiguous Codestream box</a></li>
88 <li><a href="#siz-marker">Image and tile size (SIZ) marker segment (child of Contiguous Codestream box)</a></li>
89 <li><a href="#cod-marker">Coding style default (COD) marker segment</a></li>
90 <li><a href="#coc-marker">Coding style component (COC) marker segment</a></li>
91 <li><a href="#rgn-marker">Region-of-interest (RGN) marker segment</a></li>
92 <li><a href="#qcd-marker">Quantization default (QCD) marker segment</a></li>
93 <li><a href="#qcc-marker">Quantization component (QCC) marker segment</a></li>
94 <li><a href="#poc-marker">Progression order change (POC) marker segment</a></li>
95 <li><a href="#crg-marker">Component registration (CRG) marker segment</a></li>
96 <li><a href="#com-marker">Comment (COM) marker segment</a></li>
97 <li><a href="#tile-part">Tile part (child of Contiguous Codestream box)</a></li>
98 <li><a href="#sot-marker">Start of tile part (SOT) marker segment (child of tile part)</a></li>
99 <li><a href="#tlm-marker">Tile-part lengths (TLM) marker segment</a></li>
100 <li><a href="#plm-marker">Packet length, main header (PLM) marker segment</a></li>
101 <li><a href="#ppm-marker">Packed packet headers, main header (PPM) marker segment</a></li>
102 <li><a href="#plt-marker">Packet length, tile-part header (PLT) marker segment</a></li>
103 <li><a href="#ppt-marker">Packed packet headers, tile-part header (PPT) marker segment</a></li>
104 </ul></li>
105 <li><a href="#references">References</a></li>
106 </ul>
107 </nav>
108
109
110 <h1 id="introduction">Introduction</h1>
111
112
113 <h2 id="about-jpylyzer">About jpylyzer</h2>
114
115
116 <p>This User Manual documents <em>jpylyzer</em>, a validator and feature extractor for JP2 images. JP2 is the still image format that is defined by JPEG 2000 Part 1 (ISO/IEC 15444-1). <em>Jpylyzer</em> was specifically created to answer the following questions that you might have about any JP2 file:</p>
117
118
119 <ol type="1">
120 <li><p>Is this really a JP2 and does it really conform to the format’s specifications (validation)?</p></li>
121 <li><p>What are the technical characteristics of this image (feature extraction)?</p></li>
122 </ol>
123
124
125 <h2 id="validation-scope-and-restrictions">Validation: scope and restrictions</h2>
126
127
128 <p>Since the word ‘validation’ means different things to different people, a few words about the overall scope of <em>jpylyzer</em>. First of all, it is important to stress that <em>jpylyzer</em> is not a ‘one stop solution’ that will tell you that an image is 100% perfect. What <em>jpylyzer</em> does is this: based on the JP2 format specification (ISO/IEC 15444-1), it parses a file. It then subjects the file’s contents to a large number of tests, each of which is based on the requirements and restrictions that are defined by the standard. If a file fails one or more tests, this implies that it does not conform to the standard, and is no valid JP2. Importantly, this presumes that <em>jpylyzer</em>’s tests accurately reflect the format specification, without producing false positives.</p>
129
130
131 <h3 id="valid-means-probably-valid">‘Valid’ means ‘probably valid’</h3>
132
133
134 <p>If a file passes all tests, this is an indication that it is <em>probably</em> valid JP2. This (intentionally) implies a certain degree of remaining uncertainty, which is related to the following.</p>
135
136
137 <p>First of all, <em>jpylyzer</em> (or any other format validator for that matter) ‘validates’ a file by trying to prove that it does <em>not</em> conform to the standard. It cannot prove that that a file <em>does</em> conform to the standard.</p>
138
139
140 <p>Related to this, even though <em>jpylyzer</em>’s validation process is very comprehensive, it is not complete. For instance, the validation of JPEG 2000 codestreams at this moment is still somewhat limited. These limitations are discussed in detail <a href="#limitations-codestream-validation">here</a>. Some of these limitations (e.g. optional codestream segment markers that are only minimally supported at this stage) may be taken away in upcoming versions of the tool.</p>
141
142
143 <h3 id="no-check-on-compressed-bitstreams">No check on compressed bitstreams</h3>
144
145
146 <p>One important limitation that most certainly will <em>not</em> be addressed in any upcoming versions is that <em>jpylyzer</em> does not analyse the data in the compressed bitstream segments. Doing so would involve decoding the whole image, and this is completely out of <em>jpylyzer</em>’s scope. As a result, it is possible that a JP2 that passes each of <em>jpylyzer</em>’s tests will nevertheless fail to render correctly in a viewer application.</p>
147
148
149 <h3 id="recommendations-for-use-in-quality-assurance-workflows">Recommendations for use in quality assurance workflows</h3>
150
151
152 <p>Because of the foregoing, a thorough JP2 quality assurance workflow should not rely on <em>jpylyzer</em> (or any other format validator) alone, but it should include other tests as well. Some obvious examples are:</p>
153
154
155 <ul>
156 <li><p>A rendering test that checks if a file renders at all</p></li>
157 <li><p>Format migration workflows (e.g. TIFF to JP2) should ideally also include some comparison between source and destination images (e.g. a pixel-wise comparison)</p></li>
158 </ul>
159
160
161 <p>Conversely, an image that successfully passes a rendering test or pixel-wise comparison may still contain problematic features (e.g. incorrect colour space information), so validation, rendering tests and pixel-wise comparisons are really complementary to each other.</p>
162
163
164 <h3 id="note-on-icc-profile-support">Note on ICC profile support</h3>
165
166
167 <p>The support of ICC profiles in JP2 was recently extended through an <a href="https://www.itu.int/rec/T-REC-T.800-201303-P!Amd6/en">amendment</a> to the standard. These changes are taken into account by <em>jpylyzer</em>, which is in line with the most recent version of the (updated) standard.</p>
168
169
170 <h2 id="outline">Outline of this User Manual</h2>
171
172
173 <p>We start by describing the <a href="#installation">installation process</a> of <em>jpylyzer</em> for Windows and Unix-based systems. We then explain its <a href="#using-jpylyzer">basic usage</a>, either as a command-line tool, or as an importable Python module. This is followed by a brief overview of <a href="#structure-jp2">the structure of the JP2 format</a> and its ‘box’ structure, and an explanation of <em>Jpylyzer</em>’s <a href="#output-format">output format</a>. The final sections give a detailed description of the tests that <em>jpylyzer</em> performs for validation, and the properties that are reported in the output. The <a href="#jp2-box-by-box">penultimate section</a> does this for all ‘boxes’, except the ‘Contiguous Codestream’ box, which is given a <a href="#contiguous-codestream-box-chapter">section of its own</a>.</p>
174
175
176 <h2 id="funding">Funding</h2>
177
178
179 <p>The development of <em>jpylyzer</em> was funded by the EU FP 7 project SCAPE (SCAlable Preservation Environments). More information about this project can be found here:</p>
180
181
182 <p><a href="https://www.scape-project.eu/">https://www.scape-project.eu/</a></p>
183
184
185 <h2 id="license">License</h2>
186
187
188 <p><em>Jpylyzer</em> is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see:</p>
189
190
191 <p><a href="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</a></p>
192
193
194 <p>On Debian systems, the complete text of the GNU Lesser General Public License version 3 can be found in:</p>
195
196
197 <pre><code>/usr/share/common-licenses/LGPL-3</code></pre>
198
199
200 <h1 id="installation">Installation and set-up</h1>
201
202
203 <h2 id="obtaining-the-software">Obtaining the software</h2>
204
205
206 <p>To obtain the latest version of the software please use the download links at the <em>jpylyzer</em> homepage:</p>
207
208
209 <p><a href="https://jpylyzer.openpreservation.org/" class="uri">https://jpylyzer.openpreservation.org/</a></p>
210
211
212 <p>You have three options:</p>
213
214
215 <ol type="1">
216 <li><p>Install the software with the <em>Pip</em> package manager. This works on all platforms (Windows, Linux, Mac, etc.), but you need to have the Python interpreter available on your system. Jpylyzer is compatible with Python 2.7, and Python 3.2 and more recent (Python 3.0 and 3.1 are not supported).</p></li>
217 <li><p>Alternatively, for Windows users there is also a set of stand-alone binaries<a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a>. These allow you to run <em>jpylyzer</em> as an executable Windows application, without any need for installing Python. This option is particularly useful for Windows users who cannot (or don’t want to) install software on their system.</p></li>
218 <li><p>For Linux users Debian packages are available.</p></li>
219 </ol>
220
221
222 <p>These options are described in the following sub-sections.</p>
223
224
225 <h2 id="installation-pip">Installation with Pip (Linux/Unix, Windows, Mac OS X)</h2>
226
227
228 <h3 id="general-installation-procedure">General installation procedure</h3>
229
230
231 <p>First make sure you have a recent version of <em>pip</em>. Then install <em>jpylyzer</em> with the following command:</p>
232
233
234 <pre><code>pip install jpylyzer</code></pre>
235
236
237 <h3 id="single-user-installation-linux">Single user installation (Linux)</h3>
238
239
240 <p>On most Linux systems the above command needs to be run as super user (see below). If you don’t want this use the below command for a single-user install:</p>
241
242
243 <pre><code>pip install jpylyzer --user</code></pre>
244
245
246 <p>This will install the software to the <code>.local</code> folder (hidden by default!) in your home directory (<code>~/.local</code>). Next try to run <em>jpylyzer</em> by entering:</p>
247
248
249 <pre><code>jpylyzer</code></pre>
250
251
252 <p>Most likely this will result in:</p>
253
254
255 <pre><code>jpylyzer: command not found</code></pre>
256
257
258 <p>If this happens, add the directory <code>~/.local/bin</code> (which is where the jpylyzer command-line tool is installed) to the <code>PATH</code> environment variable (you only need to do this once). To do this, locate the (hidden) file <code>.profile</code> in you home directory (<code>~/</code>), and open it in a text editor. Then add the following lines at the end of the file:</p>
259
260
261 <pre><code># set PATH so it includes the user's .local bin if it exists
262 if [ -d "$HOME/.local/bin" ] ; then
263 PATH="$HOME/.local/bin:$PATH"
264 fi</code></pre>
265
266
267 <p>Save the file, log out of your session and then log in again. Open a command terminal and type:</p>
268
269
270 <pre><code>jpylyzer</code></pre>
271
272
273 <p>If all went well you now see this:</p>
274
275
276 <pre><code>usage: jpylyzer [-h] [--format FMT] [--legacyout] [--mix {1,2}] [--nopretty]
277 [--nullxml] [--recurse] [--packetmarkers] [--verbose]
278 [--version] [--wrapper]
279 jp2In [jp2In ...]
280 jpylyzer: error: the following arguments are required: jp2In</code></pre>
281
282
283 <p>Which means that the installation was successful!</p>
284
285
286 <h3 id="global-installation-linux">Global installation (Linux)</h3>
287
288
289 <p>Simply enter:</p>
290
291
292 <pre><code>sudo -H pip install jpylyzer</code></pre>
293
294
295 <p>No further configuration is needed in this case.</p>
296
297
298 <h3 id="note-on-pre-releases">Note on pre-releases</h3>
299
300
301 <p>The above command lines will only install stable versions of jpylyzer. In order to install the latest pre-release, add the <code>--pre</code> switch. For example:</p>
302
303
304 <pre><code>sudo -H pip install jpylyzer --pre</code></pre>
305
306
307 <h2 id="installation-windows">Installation of Windows binaries (Windows only)</h2>
308
309
310 <p>Download the binary using the link on the <em>jpylyzer</em> homepage. Unzip the contents of this file to an empty folder on your PC. <em>Jpylyzer</em> should now be ready for use.</p>
311
312
313 <h3 id="testing-the-installation">Testing the installation</h3>
314
315
316 <p>To test your installation, open a Command Prompt (‘DOS prompt’) and type:</p>
317
318
319 <pre><code>%jpylyzerPath%\jpylyzer</code></pre>
320
321
322 <p>In the above command, replace <em>%jpylyzerPath%</em> with the full path to the <em>jpylyzer</em> installation directory (i.e. the directory that contains ‘jpylyzer.exe’ and its associated files). For example, if you extracted the files to directory <code>c:\tools\jpylyzer</code>, the command would become:</p>
323
324
325 <pre><code>c:\tools\jpylyzer\jpylyzer</code></pre>
326
327
328 <p>Executing this command should result in the following screen output:</p>
329
330
331 <pre><code>usage: jpylyzer [-h] [--format FMT] [--legacyout] [--mix {1,2}] [--nopretty]
332 [--nullxml] [--recurse] [--packetmarkers] [--verbose]
333 [--version] [--wrapper]
334 jp2In [jp2In ...]
335 jpylyzer: error: the following arguments are required: jp2In</code></pre>
336
337
338 <h3 id="running-jpylyzer-without-typing-the-full-path">Running jpylyzer without typing the full path</h3>
339
340
341 <p>Optionally, you may also want to add the full path of the <em>jpylyzer</em> installation directory to the Windows ’Path’ environment variable. Doing so allows you to run <em>jpylyzer</em> from any directory on your PC without having to type the full path. In Windows 7 you can do this by selecting ‘settings’ from the ‘Start’ menu; then go to ‘control panel’/’system’ and go to the ‘advanced’ tab. Click on the ‘environment variables’ button. Finally, locate the ‘Path’ variable in the ‘system variables’ window, click on ‘Edit’ and add the full <em>jpylyzer</em> path (this requires local Administrator privileges). The settings take effect on any newly opened command prompt.</p>
342
343
344 <h2 id="installation-debian">Installation of Debian packages (Ubuntu/Linux)</h2>
345
346
347 <p>For Linux, Debian packages of <em>jpylyzer</em> exist. To install, simply download the <em>.deb</em> file, double-click on it and select <em>Install Package</em>. Alternatively you can also do this in the command terminal by typing:</p>
348
349
350 <pre><code>sudo dpkg -i opf-jpylyzer_2.0.0_all.deb</code></pre>
351
352
353 <p>In both cases you need to have administrative privileges.</p>
354
355
356 <p>For <em>Ubuntu</em> and <em>Debian</em> alternative packages are available in the official release channels. To install simply run the following commands:</p>
357
358
359 <pre><code>sudo apt-get update
360 sudo apt-get install python-jpylyzer</code></pre>
361
362
363 <h1 id="using-jpylyzer">Using <em>jpylyzer</em></h1>
364
365
366 <h2 id="using-overview">Overview</h2>
367
368
369 <p>This section describes the general use of <em>jpylyzer</em>. The first sub-sections cover the use of <em>jpylyzer</em> as a command-line tool and as an importable Python module.</p>
370
371
372 <h2 id="command-line-usage">Command-line usage</h2>
373
374
375 <p>This section explains <em>jpylyzer</em>’s general command-line interface. For the sake of brevity, full paths to <em>jpylyzer</em> are omitted. This means that, depending on your system and settings, you may have to substitute each occurrence of ‘jpylyzer’ with its full path, the corresponding Windows binary, or a combination of both. The following examples illustrate this:</p>
376
377
378 <table>
379 <thead>
380 <tr class="header">
381 <th style="text-align: left;">This User Manual</th>
382 <th style="text-align: left;">jpylyzer</th>
383 </tr>
384 </thead>
385 <tbody>
386 <tr class="odd">
387 <td style="text-align: left;">Substitution example Linux</td>
388 <td style="text-align: left;"><code>/home/jpylyzer/jpylyzer</code></td>
389 </tr>
390 <tr class="even">
391 <td style="text-align: left;">Substitution example Windows binaries</td>
392 <td style="text-align: left;"><code>c:\tools\jpylyzer\jpylyzer</code></td>
393 </tr>
394 </tbody>
395 </table>
396
397
398 <p>Furthermore, command line arguments that are given between square brackets (example: <code>[-h]</code>) are optional.</p>
399
400
401 <h3 id="synopsis">Synopsis</h3>
402
403
404 <p><em>Jpylyzer</em> can be invoked using the following command-line arguments:</p>
405
406
407 <pre><code>usage: jpylyzer [-h] [--format FMT] [--legacyout] [--mix {1,2}] [--nopretty]
408 [--nullxml] [--recurse] [--packetmarkers] [--verbose]
409 [--version] [--wrapper]
410 jp2In [jp2In ...]</code></pre>
411
412
413 <h4 id="positional-arguments">Positional arguments</h4>
414
415
416 <table>
417 <thead>
418 <tr class="header">
419 <th style="text-align: left;">Argument</th>
420 <th style="text-align: left;">Description</th>
421 </tr>
422 </thead>
423 <tbody>
424 <tr class="odd">
425 <td style="text-align: left;"><code>jp2In</code></td>
426 <td style="text-align: left;">input JP2 image(s), may be one or more (whitespace-separated) path expressions; prefix wildcard (*) with backslash (\) in Linux</td>
427 </tr>
428 </tbody>
429 </table>
430
431
432 <h4 id="optional-arguments">Optional arguments</h4>
433
434
435 <table>
436 <thead>
437 <tr class="header">
438 <th style="text-align: left;">Argument</th>
439 <th style="text-align: left;">Description</th>
440 </tr>
441 </thead>
442 <tbody>
443 <tr class="odd">
444 <td style="text-align: left;"><code>[-h, --help]</code></td>
445 <td style="text-align: left;">show help message and exit</td>
446 </tr>
447 <tr class="even">
448 <td style="text-align: left;"><code>[--format FMT]</code></td>
449 <td style="text-align: left;">validation format; allowed values are <code>jp2</code> (used by default) and <code>j2c</code> (which activates raw codestream validation)</td>
450 </tr>
451 <tr class="odd">
452 <td style="text-align: left;"><code>[--mix {1,2}]</code></td>
453 <td style="text-align: left;">report additional output in NISO MIX format (version 1.0 or 2.0)</td>
454 </tr>
455 <tr class="even">
456 <td style="text-align: left;"><code>[--legacyout]</code></td>
457 <td style="text-align: left;">report output in jpylyzer 1.x format (provided for backward compatibility only)</td>
458 </tr>
459 <tr class="odd">
460 <td style="text-align: left;"><code>[--nopretty]</code></td>
461 <td style="text-align: left;">suppress pretty-printing of XML output</td>
462 </tr>
463 <tr class="even">
464 <td style="text-align: left;"><code>[--nullxml]</code></td>
465 <td style="text-align: left;">extract null-terminated XML content from XML and UUID boxes(doesn’t affect validation)</td>
466 </tr>
467 <tr class="odd">
468 <td style="text-align: left;"><code>[--recurse, -r]</code></td>
469 <td style="text-align: left;">when analysing a directory, recurse into subdirectories (implies <code>--wrapper</code> if <code>--legacyout</code> is used)</td>
470 </tr>
471 <tr class="even">
472 <td style="text-align: left;"><code>[--packetmarkers]</code></td>
473 <td style="text-align: left;">Report packet-level codestream markers (plm, ppm, plt, ppt)</td>
474 </tr>
475 <tr class="odd">
476 <td style="text-align: left;"><code>[--verbose]</code></td>
477 <td style="text-align: left;">report test results in verbose format</td>
478 </tr>
479 <tr class="even">
480 <td style="text-align: left;"><code>[-v, --version]</code></td>
481 <td style="text-align: left;">show program’s version number and exit</td>
482 </tr>
483 <tr class="odd">
484 <td style="text-align: left;"><code>[--wrapper, -w]</code></td>
485 <td style="text-align: left;">wrap output for individual image(s) in ‘results’ XML element (deprecated from jpylyzer 2.x onward, only takes effect if <code>--legacyout</code> is used)</td>
486 </tr>
487 </tbody>
488 </table>
489
490
491 <p>Note that the input can either be a single image, a space-separated sequence of images, a pathname expression that includes multiple images, or any combination of the above. For example, the following command will process one single image:</p>
492
493
494 <pre><code>jpylyzer rubbish.jp2</code></pre>
495
496
497 <p>The next example shows how to process all files with a ‘jp2’ extension in the current directory:</p>
498
499
500 <pre><code>jpylyzer *.jp2</code></pre>
501
502
503 <p>Note that on Unix/Linux based systems pathname expressions may not work properly unless you wrap them in quotation marks:</p>
504
505
506 <pre><code>jpylyzer "*.jp2"</code></pre>
507
508
509 <h3 id="output-redirection">Output redirection</h3>
510
511
512 <p>All output (except warning and system error messages) is directed to the standard output device (stdout). By default this is the console screen. Use your platform’s standard output redirection operators to redirect output to a file. The most common situation will be to redirect the output of one invocation of <em>jpylyzer</em> to an XML file, which can be done with the ‘&gt;’ operator (both under Windows and Linux):</p>
513
514
515 <pre><code>jpylyzer jp2In &gt; outputFile</code></pre>
516
517
518 <p>E.g. the following command will run <em>jpylyzer</em> on image ‘rubbish.jp2’ and redirects the output to file ‘rubbish.xml’:</p>
519
520
521 <pre><code>jpylyzer rubbish.jp2 &gt; rubbish.xml</code></pre>
522
523
524 <p>The format of the XML output is described <a href="#output-format">here</a>.</p>
525
526
527 <h3 id="format-option">‘format’ option</h3>
528
529
530 <p>By default, <em>jpylyzer</em> validates against the <em>JP2</em> format specification. Starting with version 2.0, <em>jpylyzer</em> can also validate raw JPEG 2000 codestreams that are not wrapped inside a <em>JP2</em> container. For codestream validation, use the <code>--format</code> option with value <code>j2c</code>, e.g.:</p>
531
532
533 <pre><code>jpylyzer --format j2c rubbish.j2c &gt; rubbish.xml</code></pre>
534
535
536 <h3 id="mix-option">‘mix’ option</h3>
537
538
539 <p>When this option is used, <em>jpylyzer</em> reports additional output in <a href="https://www.loc.gov/standards/mix/"><em>NISO MIX</em></a> format. This option takes one argument that defines whether <em>MIX</em> 1.0 or <em>MIX</em> 2.0 is used. For example, the following command will result in <em>MIX</em> 2.0 output:</p>
540
541
542 <pre><code>jpylyzer --mix 2 rubbish.jp2 &gt; rubbish.xml</code></pre>
543
544
545 <p>The <em>MIX</em> output is wrapped inside a <em>file/propertiesExtension</em> element. Note that <em>MIX</em> output is <em>only</em> written for files that are valid JP2 (files that are not valid result in an empty <em>propertiesExtension</em> element). Also, the <code>--mix</code> option is ignored if <code>--format</code> is set to <code>j2c</code>, or if <code>--legacyout</code> (see below) is used.</p>
546
547
548 <h3 id="legacyout-option">‘legacyout’ option</h3>
549
550
551 <p>The output format of <em>jpylyzer</em> has changed in version 2.0, which may break existing workflows that expect output in 1.x format. For backward compatibility the <code>--legacyout</code> option results in output that follows the old 1.x format. Note that codestream validation is disabled if you use this option.</p>
552
553
554 <h3 id="recurse-option">‘recurse’ option</h3>
555
556
557 <p>If the <code>--recurse</code> option is used, <em>jpylyzer</em> will recursively traverse all subdirectories of a filepath expression. E.g:</p>
558
559
560 <pre><code>jpylyzer /home/myJP2s/*.jp2 &gt; rubbish.xml</code></pre>
561
562
563 <p>In this case <em>jpylyzer</em> analyses all files that have a <em>.jp2</em> extension in directory <em>/home/myJP2s</em> and all its subdirectories.</p>
564
565
566 <h3 id="packetmarkers-option">‘packetmarkers’ option</h3>
567
568
569 <p>When this option is enabled, jpylyzer will report the properties of the following packet-level codestream markers:</p>
570
571
572 <ul>
573 <li>PLM (packet length, main header) marker</li>
574 <li>PPM (packed packet headers, main header) marker</li>
575 <li>PLT (packet length, tile-part header) marker</li>
576 <li>PPT (packed packet headers, tile-part header) marker</li>
577 </ul>
578
579
580 <p>By default these are excluded from the output, in order to prevent excessive output size.</p>
581
582
583 <h3 id="wrapper-option-deprecated">‘wrapper’ option (deprecated)</h3>
584
585
586 <p>This deprecated option is included for backward-compatibility, and only takes effect if <code>--legacyout</code> (see above) is used.By default, the <em>jpylyzer</em> 1.x releases would create a separate XML tree for each analysed image, without any overarching hierarchy. For multiple-image pathname expressions this resulted in output that was <strong>not</strong> well-formed XML. The <code>--legacyout</code> option still results in this is behaviour. For example:</p>
587
588
589 <pre><code>jpylyzer --legacyout rubbish.jp2 garbage.jp2 &gt; rubbish.xml</code></pre>
590
591
592 <p>In this case, the file ‘rubbish.xml’ contains a succession of two XML trees, which by itself is not well-formed XML. The <code>--wrapper</code> option is provided to create valid XML instead:</p>
593
594
595 <pre><code>jpylyzer --legacyout --wrapper rubbish.jp2 garbage.jp2 &gt; rubbish.xml</code></pre>
596
597
598 <p>In the above case the XML trees of the individual images are wrapped inside a ‘results’ element. When the <code>--recurse</code> option is used, jpylyzer will automatically wrap the output in a ‘results’ element, so there’s no need to specify <code>--wrapper</code> in that case.</p>
599
600
601 <p>Starting with version 2.0, <em>jpylyzer</em> <em>always</em> generates well-formed XML (unless the <code>--legacyout</code> option is used), which makes the <code>--wrapper</code> option largely obsolete, apart from cases where the ‘old’ behaviour is needed for backward-compatibility reasons.</p>
602
603
604 <h3 id="nullxml-option">‘nullxml’ option</h3>
605
606
607 <p>The <em>nullxml</em> option was added to enable extraction of XML content that is terminated by a null-byte. By default <em>jpylyzer</em> doesn’t report the XML in that case, because it throws an exception in the XML parser. Apparently some old versions of the Kakadu demo applications would erroneously add a null-byte to embedded XML, so this option can be used to force extraction for images that are affected by this.</p>
608
609
610 <h3 id="user-warnings">User warnings</h3>
611
612
613 <p>Under the following conditions <em>jpylyzer</em> will print a user warning to the standard error device (typically the console screen):</p>
614
615
616 <h4 id="no-images-to-check">No images to check</h4>
617
618
619 <p>If there are no input images to check (typically because the value of jp2In refers to a non-existent file), the following warning message is shown:</p>
620
621
622 <pre><code>User warning: no images to check!</code></pre>
623
624
625 <h4 id="unsupported-box">Unsupported box</h4>
626
627
628 <p>In some cases you will see the following warning message:</p>
629
630
631 <pre><code>User warning: ignoring 'boxName' (validator function not yet implemented)</code></pre>
632
633
634 <p>The reason for this: a JP2 file is made up of units that are called ‘boxes’. This is explained in more detail <a href="#structure-jp2">here</a>. Each ‘box’ has its own dedicated validator function. At this stage validator functions are still missing for a small number of (optional) boxes. <em>Jpylyzer</em> will display the above warning message if it encounters a (yet) unsupported box. Any unsupported boxes are simply ignored, and the remainder of the file will be analyzed (and validated) normally.</p>
635
636
637 <h4 id="error-while-processing-a-file">Error while processing a file</h4>
638
639
640 <p>In rare cases you may come across one of the following messages:</p>
641
642
643 <pre><code>User warning: memory error (file size too large)</code></pre>
644
645
646 <p>Memory errors may occur for (very) large images. If you get this warning, try using a machine with more RAM. Also, a machine’s chip architecture and the operating system may put constraints on the amount of memory that can be allocated.</p>
647
648
649 <p>The following warning indicates an input error:</p>
650
651
652 <pre><code>User warning: I/O error (cannot open file)</code></pre>
653
654
655 <p>Finally, the following messages most likely indicate a jpylyzer bug:</p>
656
657
658 <pre><code>User warning:runtime error (please report to developers)</code></pre>
659
660
661 <p>and:</p>
662
663
664 <pre><code>User warning: unknown error (please report to developers)</code></pre>
665
666
667 <p>If you ever run into either of these two errors, please get in touch with the jpylyzer developers. The easiest way to do this is to create a new issue at:</p>
668
669
670 <p><a href="https://github.com/openpreserve/jpylyzer/issues" class="uri">https://github.com/openpreserve/jpylyzer/issues</a></p>
671
672
673 <h4 id="unknown-box">Unknown box</h4>
674
675
676 <p>Occasionally, you may see this warning message:</p>
677
678
679 <pre><code>User warning: ignoring unknown box</code></pre>
680
681
682 <p>This happens if <em>jpylyzer</em> encounters a box that is not defined by JPEG 2000 Part 1. It should be noted that, to a large extent, JPEG 2000 Part 1 permits the presence of boxes that are defined outside the standard. Again, <em>jpylyzer</em> will simply ignore these and process all other boxes normally.</p>
683
684
685 <h2 id="using-as-python-module">Using <em>jpylyzer</em> as a Python module</h2>
686
687
688 <p>Instead of using <em>jpylyzer</em> from the command-line, you can also import it as a module in your own Python programs. To do so, install jpylyzer with <em>pip</em>. Then import <em>jpylyzer</em> into your code by adding:</p>
689
690
691 <pre><code>from jpylyzer import jpylyzer</code></pre>
692
693
694 <p>Subsequently you can call any function that is defined in <em>jpylyzer.py</em>. In practice you will most likely only need the <em>checkOneFile</em> function. The following minimal script shows how this works:</p>
695
696
697 <pre><code>#! /usr/bin/env python
698
699 from jpylyzer import jpylyzer
700
701 # Define JP2
702 myFile = "/home/johan/jpylyzer-test-files/aware.jp2"
703
704 # Analyse with jpylyzer, result to Element object
705 myResult = jpylyzer.checkOneFile(myFile)
706
707 # Return image height value
708 imageHeight = myResult.findtext('./properties/jp2HeaderBox/imageHeaderBox/height')
709 print(imageHeight)</code></pre>
710
711
712 <p>Here, <em>myResult</em> is an <em>Element</em> object that can either be used directly, or converted to XML using the <em>ElementTree</em> module<a href="#fn2" class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a>. The structure of the element object follows the XML output that described <a href="#output-format">here</a>.</p>
713
714
715 <p>For validation a raw JPEG 2000 codestreams, call the <em>checkOneFile</em> function with the additional <em>validationFormat</em> argument, and set it to <code>j2c</code>:</p>
716
717
718 <pre><code># Define Codestream
719 myFile = "/home/johan/jpylyzer-test-files/rubbish.j2c"
720
721 # Analyse with jpylyzer, result to Element object
722 myResult = jpylyzer.checkOneFile(myFile, 'j2c')</code></pre>
723
724
725 <h2 id="java-integration">Java integration</h2>
726
727
728 <p>It is possible to integrate <em>jpylyzer</em> into Java applications. A test class that shows how this works is included in the source repo <a href="https://github.com/openpreserve/jpylyzer/tree/master/jpylyzer/java_demo/CallJpylyzer.java">here</a>. This requires <a href="https://www.jython.org/">Jython</a>. Note that you may run into performance issues with (very) large images in this case, as Jython does not support <a href="https://docs.python.org/3/library/mmap.html">memory mapping</a>, so make sure you’ve got plenty of RAM available.</p>
729
730
731 <h1 id="structure-jp2">Structure of a JP2 file</h1>
732
733
734 <h2 id="structure-scope">Scope of this section</h2>
735
736
737 <p>This section gives a brief overview of the JP2 file format. A basic understanding of the general structure of JP2 is helpful for appreciating how <em>jpylyzer</em> performs its validation. It will also make it easier to understand <em>jpylyzer</em>‘s extracted properties, as these are reported as a hierarchical tree that corresponds to the internal structure of JP2.</p>
738
739
740 <p>For an exhaustive description of every detail of the format you are advised to consult Annex I (‘JP2 file format syntax’) and Annex A (‘Codestream syntax’) of ISO/IEC 15444-1.</p>
741
742
743 <h2 id="general-format-structure">General format structure</h2>
744
745
746 <p>At the highest level, a JP2 file is made up of a collection of <em>boxes</em>. A <em>box</em> can be thought of as the fundamental building block of the format. Some boxes (‘superboxes’) are containers for other boxes. The Figure below gives an overview of the top-level boxes in a JP2 file.</p>
747
748
749 <figure>
750 <img src="images/jp2FormatStructure.png" alt="Top-level overview of a JP2 file. Boxes with dashed borders are optional."/><figcaption aria-hidden="true">Top-level overview of a JP2 file. Boxes with dashed borders are optional.</figcaption>
751 </figure>
752
753
754 <p>A number of things here are noteworthy to point out:</p>
755
756
757 <ul>
758 <li><p>Some of these boxes are required, whereas others (indicated with dashed lines in the Figure) are optional.</p></li>
759 <li><p>The order in which the boxes appear in the file is subject to some constraints (e.g. the first box in a JP2 must always be a ‘Signature’ box, followed by a ‘File Type’ box).</p></li>
760 <li><p>Some boxes may have multiple instances (e.g. ‘Contiguous Codestream’ box), whereas others must be unique (e.g. ‘JP2 Header’ box).</p></li>
761 </ul>
762
763
764 <p>More specific details can be found in the standard. The important thing here is that requirements like the above are something that should be verified by a validator, and this is exactly what <em>jpylyzer</em> does at the highest level of its validation procedure.</p>
765
766
767 <h2 id="general-box-structure">General structure of a box</h2>
768
769
770 <p>All boxes are defined by a generic binary structure, which is illustrated by the following Figure:</p>
771
772
773 <figure>
774 <img src="images/boxStructure.png" alt="General structure of a box."/><figcaption aria-hidden="true">General structure of a box.</figcaption>
775 </figure>
776
777
778 <p>Most boxes are made up of the following three components:</p>
779
780
781 <ol type="1">
782 <li><p>A fixed-length ‘box length’ field that indicates the total size of the box (in bytes).</p></li>
783 <li><p>A fixed-length ‘box type’ field which specifies the type of information that can be found in this box</p></li>
784 <li><p>The box contents, which contains the actual information within the box. Its internal format depends on the box type. The box contents of a ‘superbox’ will contain its child boxes (which can be parsed recursively).</p></li>
785 </ol>
786
787
788 <p>In some cases a box will also contain an ‘extended box length field’. This field is needed if the size of a box exceeds 2<sup>32</sup>-1 bytes, which is the maximum value that can be stored in the 4-byte ‘box length’ field.</p>
789
790
791 <h2 id="defined-boxes">Defined boxes in JP2</h2>
792
793
794 <p>The following Table (taken from Table I.2 in ISO/IEC 15444-1, with minor modifications) lists all boxes that are defined in the standard. Addition signs in the ‘box name’ column indicate boxes that are children of a ‘superbox’.</p>
795
796
797 <table>
798 <thead>
799 <tr class="header">
800 <th style="text-align: left;">Box name</th>
801 <th style="text-align: left;">Superbox</th>
802 <th style="text-align: left;">Required?</th>
803 <th style="text-align: left;">Purpose</th>
804 </tr>
805 </thead>
806 <tbody>
807 <tr class="odd">
808 <td style="text-align: left;">JPEG 2000 Signature box</td>
809 <td style="text-align: left;">No</td>
810 <td style="text-align: left;">Required</td>
811 <td style="text-align: left;">Identifies the file as being part of the JPEG 2000 family of files.</td>
812 </tr>
813 <tr class="even">
814 <td style="text-align: left;">File Type box</td>
815 <td style="text-align: left;">No</td>
816 <td style="text-align: left;">Required</td>
817 <td style="text-align: left;">Specifies file type, version and compatibility information, including specifying if this file is a conforming JP2 file or if it can be read by a conforming JP2 reader.</td>
818 </tr>
819 <tr class="odd">
820 <td style="text-align: left;">JP2 Header box</td>
821 <td style="text-align: left;">Yes</td>
822 <td style="text-align: left;">Required</td>
823 <td style="text-align: left;">Contains a series of boxes that contain header-type information about the file.</td>
824 </tr>
825 <tr class="even">
826 <td style="text-align: left;">+ Image Header box</td>
827 <td style="text-align: left;">No</td>
828 <td style="text-align: left;">Required</td>
829 <td style="text-align: left;">Specifies the size of the image and other related fields.</td>
830 </tr>
831 <tr class="odd">
832 <td style="text-align: left;">+ Bits Per Component box</td>
833 <td style="text-align: left;">No</td>
834 <td style="text-align: left;">Optional</td>
835 <td style="text-align: left;">Specifies the bit depth of the components in the file in cases where the bit depth is not constant across all components.</td>
836 </tr>
837 <tr class="even">
838 <td style="text-align: left;">+ Colour Specification box</td>
839 <td style="text-align: left;">No</td>
840 <td style="text-align: left;">Required</td>
841 <td style="text-align: left;">Specifies the colourspace of the image.</td>
842 </tr>
843 <tr class="odd">
844 <td style="text-align: left;">+ Palette box</td>
845 <td style="text-align: left;">No</td>
846 <td style="text-align: left;">Optional</td>
847 <td style="text-align: left;">Specifies the palette which maps a single component in index space to a multiple-component image.</td>
848 </tr>
849 <tr class="even">
850 <td style="text-align: left;">+ Component Mapping box</td>
851 <td style="text-align: left;">No</td>
852 <td style="text-align: left;">Optional</td>
853 <td style="text-align: left;">Specifies the mapping between a palette and codestream components.</td>
854 </tr>
855 <tr class="odd">
856 <td style="text-align: left;">+ Channel Definition box</td>
857 <td style="text-align: left;">No</td>
858 <td style="text-align: left;">Optional</td>
859 <td style="text-align: left;">Specifies the type and ordering of the components within the codestream, as well as those created by the application of a palette.</td>
860 </tr>
861 <tr class="even">
862 <td style="text-align: left;">+ Resolution box</td>
863 <td style="text-align: left;">Yes</td>
864 <td style="text-align: left;">Optional</td>
865 <td style="text-align: left;">Contains the grid resolution.</td>
866 </tr>
867 <tr class="odd">
868 <td style="text-align: left;">++ Capture Resolution box</td>
869 <td style="text-align: left;">No</td>
870 <td style="text-align: left;">Optional</td>
871 <td style="text-align: left;">Specifies the grid resolution at which the image was captured.</td>
872 </tr>
873 <tr class="even">
874 <td style="text-align: left;">++ Default Display Resolution box</td>
875 <td style="text-align: left;">No</td>
876 <td style="text-align: left;">Optional</td>
877 <td style="text-align: left;">Specifies the default grid resolution at which the image should be displayed.</td>
878 </tr>
879 <tr class="odd">
880 <td style="text-align: left;">Contiguous Codestream box</td>
881 <td style="text-align: left;">No</td>
882 <td style="text-align: left;">Required</td>
883 <td style="text-align: left;">Contains the codestream.</td>
884 </tr>
885 <tr class="even">
886 <td style="text-align: left;">Intellectual Property box</td>
887 <td style="text-align: left;">No</td>
888 <td style="text-align: left;">Optional</td>
889 <td style="text-align: left;">Contains intellectual property information about the image.</td>
890 </tr>
891 <tr class="odd">
892 <td style="text-align: left;">XML box</td>
893 <td style="text-align: left;">No</td>
894 <td style="text-align: left;">Optional</td>
895 <td style="text-align: left;">Provides a tool by which vendors can add XML formatted information to a JP2 file.</td>
896 </tr>
897 <tr class="even">
898 <td style="text-align: left;">UUID box</td>
899 <td style="text-align: left;">No</td>
900 <td style="text-align: left;">Optional</td>
901 <td style="text-align: left;">Provides a tool by which vendors can add additional information to a file without risking conflict with other vendors.</td>
902 </tr>
903 <tr class="odd">
904 <td style="text-align: left;">UUID Info box</td>
905 <td style="text-align: left;">Yes</td>
906 <td style="text-align: left;">Optional</td>
907 <td style="text-align: left;">Provides a tool by which a vendor may provide access to additional information associated with a UUID.</td>
908 </tr>
909 <tr class="even">
910 <td style="text-align: left;">+ UUID List box</td>
911 <td style="text-align: left;">No</td>
912 <td style="text-align: left;">Optional</td>
913 <td style="text-align: left;">Specifies a list of UUIDs.</td>
914 </tr>
915 <tr class="odd">
916 <td style="text-align: left;">+ URL box</td>
917 <td style="text-align: left;">No</td>
918 <td style="text-align: left;">Optional</td>
919 <td style="text-align: left;">Specifies a URL.</td>
920 </tr>
921 </tbody>
922 </table>
923
924
925 <p>A JP2 file may contain boxes that are not defined by the standard. Such boxes are simply skipped and ignored by conforming reader applications.</p>
926
927
928 <h1 id="output-format">Output format</h1>
929
930
931 <p>This section explains <em>jpylyzer</em>’s output format.</p>
932
933
934 <h2 id="output-format-overview">Overview</h2>
935
936
937 <p><em>Jpylyzer</em> generates its output in XML format, which is defined by <a href="https://jpylyzer.openpreservation.org/jpylyzer-v-2-1.xsd">the schema that can be found here</a>. The following Figure shows the output structure:</p>
938
939
940 <figure>
941 <img src="images/outputStructure.png" alt="Jpylyzer’s XML output structure. ‘box’ elements under ‘tests’ and ‘properties’ contain further sub-elements."/><figcaption aria-hidden="true">Jpylyzer’s XML output structure. ‘box’ elements under ‘tests’ and ‘properties’ contain further sub-elements.</figcaption>
942 </figure>
943
944
945 <p>The root element (<em>jpylyzer</em>) contains the following child elements:</p>
946
947
948 <ol type="1">
949 <li><p>one <em>toolInfo</em> element, which contains information about <em>jpylyzer</em></p></li>
950 <li><p>one or more <em>file</em> elements, each of which contain information about about the analysed files</p></li>
951 </ol>
952
953
954 <p>The XML output is pretty-printed. You can use the <code>--nopretty</code> switch to disable pretty-printing (this produces smaller files and may give a slightly better performance).</p>
955
956
957 <h2 id="toolinfo-element">toolInfo element</h2>
958
959
960 <p>This element holds information about <em>jpylyzer</em>. Currently it contains the following sub-elements:</p>
961
962
963 <ul>
964 <li><p><em>toolName</em>: name of the analysis tool (i.e. <em>jpylyzer</em> or <em>jpylyzer.exe</em>, depending on the platform used)</p></li>
965 <li><p><em>toolVersion</em>: version of <em>jpylyzer</em> (<em>jpylyzer</em> uses a date versioning scheme)</p></li>
966 </ul>
967
968
969 <h2 id="file-element">file element</h2>
970
971
972 <p>The <em>file</em> element contains the following sub-elements:</p>
973
974
975 <ol type="1">
976 <li><p><em>fileInfo</em>: general information about the analysed file</p></li>
977 <li><p><em>statusInfo</em>: information about the status of <em>jpylyzer</em>’s validation attempt</p></li>
978 <li><p><em>isValid</em>: outcome of the validation</p></li>
979 <li><p><em>tests</em>: outcome of the individual tests that are part of the validation process (organised by box)</p></li>
980 <li><p><em>properties</em>: image properties (organised by box)</p></li>
981 <li><p><em>propertiesExtension</em>: wrapper element for NISO <em>MIX</em> output (only if the <code>--mix</code> option is used)</p></li>
982 </ol>
983
984
985 <h2 id="fileinfo-element">fileInfo element</h2>
986
987
988 <p>This element holds general information about the analysed file. Currently it contains the following sub-elements:</p>
989
990
991 <ul>
992 <li><p><em>filename</em>: name of the analysed file without its path (e.g. “rubbish.jp2”)</p></li>
993 <li><p><em>filePath</em>: name of the analysed file, including its full absolute path (e.g. “d:\data\images\rubbish.jp2”)</p></li>
994 <li><p><em>fileSizeInBytes</em>: file size in bytes</p></li>
995 <li><p><em>fileLastModified</em>: last modified date and time</p></li>
996 </ul>
997
998
999 <h2 id="statusinfo-element">statusInfo element</h2>
1000
1001
1002 <p>This element holds general information about about the status of <em>jpylyzer</em>’s attempt at validating a file. It tells you whether the validation process could be completed without any internal <em>jpylyzer</em> errors. It contains the following sub-elements:</p>
1003
1004
1005 <ul>
1006 <li><p><em>success</em>: a Boolean flag that indicates whether the validation attempt completed normally (“True”) or not (“False”). A value of “False” indicates an internal error that prevented <em>jpylyzer</em> from validating the file.</p></li>
1007 <li><p><em>failureMessage</em>: if the validation attempt failed (value of <em>success</em> equals “False”), this field gives further details about the reason of the failure. Examples are:</p>
1008 <ul>
1009 <li><code>memory error (file size too large)</code></li>
1010 <li><code>runtime error (please report to developers)</code></li>
1011 <li><code>unknown error (please report to developers)</code></li>
1012 </ul></li>
1013 </ul>
1014
1015
1016 <h2 id="isvalid-element">isValid element</h2>
1017
1018
1019 <p>This element contains the results of the validation. If a file passed all the tests (i.e. all tests returned “True”, see <a href="#tests-element">here</a>) it is most likely valid, and the value of <em>isValid</em> will be “True”. Its value is “False” otherwise. The element has a <em>format</em> attribute, which defines the validation format (set by the <code>--format</code> command-line option). The <em>format</em> attribute can have the following values:</p>
1020
1021
1022 <ul>
1023 <li>“jp2” (JP2 validation)</li>
1024 <li>“j2c” (raw codestream validation)</li>
1025 </ul>
1026
1027
1028 <h2 id="tests-element">tests element</h2>
1029
1030
1031 <p>This element is reserved to hold the outcomes of all the individual tests that <em>jpylyzer</em> performs to assess whether a file is valid JP2. The results are organised in a hierarchical tree that corresponds to JP2’s box structure. Each individual test can have two values:</p>
1032
1033
1034 <ul>
1035 <li><p>“True” if a file passed the test.</p></li>
1036 <li><p>“False” if a file failed the test.</p></li>
1037 </ul>
1038
1039
1040 <p>If a file passed <em>all</em> tests, this is an indication that it is most likely valid JP2. In that case, the <a href="#isvalid-element"><em>isValid</em> element</a> has a value of “True” (and “False” in all other cases). These tests are all explained <a href="#jp2-box-by-box">here</a> and <a href="#contiguous-codestream-box-chapter">here</a>.</p>
1041
1042
1043 <h3 id="default-and-verbose-reporting-of-test-results">Default and verbose reporting of test results</h3>
1044
1045
1046 <p>By default, <em>jpylyzer</em> only reports any tests that failed (i.e. returned “False”), including the corresponding part of the box structure. For a valid JP2 the tests element will be empty. If the –verbose flag is used, the results of <em>all</em> tests are included (including those that returned “True”)<a href="#fn3" class="footnote-ref" id="fnref3" role="doc-noteref"><sup>3</sup></a>.</p>
1047
1048
1049 <h2 id="properties-element">properties element</h2>
1050
1051
1052 <p>This element contains the extracted image properties, which are organised in a hierarchical tree that corresponds to JP2’s box structure. See <a href="#jp2-box-by-box">here</a> and <a href="#contiguous-codestream-box-chapter">here</a> for a description of the reported properties.</p>
1053
1054
1055 <h2 id="propertiesExtension-element">propertiesExtension element</h2>
1056
1057
1058 <p>This optional element is reserved for output in alternative formats. Currently it is used to wrap output in NISO <em>MIX</em> format if the <code>--mix</code> option is used. See the <a href="https://www.loc.gov/standards/mix/"><em>MIX</em> documentation</a> for a description of the reported elements.</p>
1059
1060
1061 <h1 id="jp2-box-by-box">JP2: box by box</h1>
1062
1063
1064 <p>The following two sections provide a detailed explanation of <em>jpylyzer</em>’s functionality and its output. In particular, the following two aspects are addressed:</p>
1065
1066
1067 <ol type="1">
1068 <li><p>The reported properties</p></li>
1069 <li><p>The tests that <em>jpylyzer</em> performs to establish the validity of a file.</p></li>
1070 </ol>
1071
1072
1073 <h2 id="about-properties-tests-trees">About the properties and tests trees</h2>
1074
1075
1076 <p>The ‘properties’ element in <em>jpylyzer</em>’s output holds a hierarchical tree structure that contains all extracted properties. The ‘tests’ tree follows the same structure. The hierarchy reflects JP2’s box structure (explained <a href="#structure-jp2">here</a>): each box is represented by a corresponding output element that contains the corresponding property entries. If a box is a superbox, the output element will contain child elements for each child box. For some boxes, the output contains further sub-elements. This applies in particular to the Contiguous Codestream box, since its contents are more complex than any of the other boxes. Also, if a Colour Specification box contains an embedded ICC profile, the properties of the ICC profile are stored in a separate sub-element. In addition to this, one ‘property’ that is reported by <em>jpylyzer</em> (the compression ratio) is not actually extracted from any particular box. Instead, it is calculated from the file size and some properties from the Header boxes. As a result, it is reported separately in the root of the properties tree.</p>
1077
1078
1079 <h3 id="naming-of-properties">Naming of properties</h3>
1080
1081
1082 <p>The naming of the reported properties largely follows the standard (ISO/IEC 15444-1). Some minor differences follow from the fact that the standard does have any consistent use of text case, whereas <em>jpylyzer</em> uses lower camel case. In addition, some parameters in the standard are compound units that aggregate a number of Boolean ‘switches’, where no names are provided for each individual switch. An example of this is the <em>Scod</em> (coding style) parameter in the codestream header, which contains three switches that define the use of precincts, start-of-packet markers and end-of-packet markers. For cases like these <em>jpylyzer</em> uses its own (largely self-descriptive) names (which are all documented in these sections).</p>
1083
1084
1085 <h2 id="jpeg2000-signature-box">JPEG 2000 Signature box</h2>
1086
1087
1088 <p>This box contains information that allows identification of the file as being part of the JPEG 2000 family of file formats.</p>
1089
1090
1091 <h3 id="element-name">Element name</h3>
1092
1093
1094 <p>signatureBox</p>
1095
1096
1097 <h3 id="reported-properties">Reported properties</h3>
1098
1099
1100 <p>None (box only holds JPEG 2000 signature, which includes non-printable characters)</p>
1101
1102
1103 <h3 id="tests">Tests</h3>
1104
1105
1106 <table>
1107 <thead>
1108 <tr class="header">
1109 <th style="text-align: left;">Test name</th>
1110 <th style="text-align: left;">True if</th>
1111 </tr>
1112 </thead>
1113 <tbody>
1114 <tr class="odd">
1115 <td style="text-align: left;">boxLengthIsValid</td>
1116 <td style="text-align: left;">Size of box contents equals 4 bytes</td>
1117 </tr>
1118 <tr class="even">
1119 <td style="text-align: left;">signatureIsValid</td>
1120 <td style="text-align: left;">Signature equals 0x0d0a870a</td>
1121 </tr>
1122 </tbody>
1123 </table>
1124
1125
1126 <h2 id="file-type-box">File Type box</h2>
1127
1128
1129 <p>This box specifies file type, version and compatibility information, including specifying if this file is a conforming JP2 file or if it can be read by a conforming JP2 reader.</p>
1130
1131
1132 <h3 id="element-name-1">Element name</h3>
1133
1134
1135 <p>fileTypeBox</p>
1136
1137
1138 <h3 id="reported-properties-1">Reported properties</h3>
1139
1140
1141 <table>
1142 <thead>
1143 <tr class="header">
1144 <th style="text-align: left;">Property</th>
1145 <th style="text-align: left;">Description</th>
1146 </tr>
1147 </thead>
1148 <tbody>
1149 <tr class="odd">
1150 <td style="text-align: left;">br</td>
1151 <td style="text-align: left;">Brand</td>
1152 </tr>
1153 <tr class="even">
1154 <td style="text-align: left;">minV</td>
1155 <td style="text-align: left;">Minor version</td>
1156 </tr>
1157 <tr class="odd">
1158 <td style="text-align: left;">cL<sup>*</sup></td>
1159 <td style="text-align: left;">Compatibility field (repeatable)</td>
1160 </tr>
1161 </tbody>
1162 </table>
1163
1164
1165 <h3 id="tests-1">Tests</h3>
1166
1167
1168 <table>
1169 <thead>
1170 <tr class="header">
1171 <th style="text-align: left;">Test name</th>
1172 <th style="text-align: left;">True if</th>
1173 </tr>
1174 </thead>
1175 <tbody>
1176 <tr class="odd">
1177 <td style="text-align: left;">boxLengthIsValid</td>
1178 <td style="text-align: left;">(Size of box – 8) /4 is a whole number (integer)</td>
1179 </tr>
1180 <tr class="even">
1181 <td style="text-align: left;">brandIsValid</td>
1182 <td style="text-align: left;"><em>br</em> equals 0x6a703220 (“jp2”)</td>
1183 </tr>
1184 <tr class="odd">
1185 <td style="text-align: left;">minorVersionIsValid</td>
1186 <td style="text-align: left;"><em>minV</em> equals 0</td>
1187 </tr>
1188 <tr class="even">
1189 <td style="text-align: left;">compatibilityListIsValid</td>
1190 <td style="text-align: left;">Sequence of compatibility (<em>cL</em>) fields includes one entry that equals 0x6a703220 (“jp2”)</td>
1191 </tr>
1192 </tbody>
1193 </table>
1194
1195
1196 <h2 id="jp2-header-box">JP2 Header box (superbox)</h2>
1197
1198
1199 <p>This box is a superbox that holds a series of boxes that contain header-type information about the file.</p>
1200
1201
1202 <h3 id="element-name-2">Element name</h3>
1203
1204
1205 <p>jp2HeaderBox</p>
1206
1207
1208 <h3 id="reported-properties-2">Reported properties</h3>
1209
1210
1211 <p>Since this is a superbox, it contains a number of child boxes. These are represented as child elements in the properties tree:</p>
1212
1213
1214 <table>
1215 <thead>
1216 <tr class="header">
1217 <th style="text-align: left;">Child element</th>
1218 <th style="text-align: left;">Description</th>
1219 </tr>
1220 </thead>
1221 <tbody>
1222 <tr class="odd">
1223 <td style="text-align: left;"><a href="#image-header-box">imageHeaderBox</a></td>
1224 <td style="text-align: left;">Properties from Image Header box (required)</td>
1225 </tr>
1226 <tr class="even">
1227 <td style="text-align: left;"><a href="#bits-per-component-box">bitsPerComponentBox</a></td>
1228 <td style="text-align: left;">Properties from Bits Per Component box (optional)</td>
1229 </tr>
1230 <tr class="odd">
1231 <td style="text-align: left;"><a href="#colour-specification-box">ColourSpecificationBox</a></td>
1232 <td style="text-align: left;">Properties from Colour Specification box (required)</td>
1233 </tr>
1234 <tr class="even">
1235 <td style="text-align: left;"><a href="#palette-box">paletteBox</a></td>
1236 <td style="text-align: left;">Properties from Palette box (optional)</td>
1237 </tr>
1238 <tr class="odd">
1239 <td style="text-align: left;"><a href="#component-mapping-box">componentMappingBox</a></td>
1240 <td style="text-align: left;">Properties from Component Mapping box (optional)</td>
1241 </tr>
1242 <tr class="even">
1243 <td style="text-align: left;"><a href="#channel-definition-box">channelDefinitionBox</a></td>
1244 <td style="text-align: left;">Properties from Channel Definition box (optional)</td>
1245 </tr>
1246 <tr class="odd">
1247 <td style="text-align: left;"><a href="#resolution-box">resolutionBox</a></td>
1248 <td style="text-align: left;">Properties from Resolution box (optional)</td>
1249 </tr>
1250 </tbody>
1251 </table>
1252
1253
1254 <h3 id="tests-2">Tests</h3>
1255
1256
1257 <table>
1258 <thead>
1259 <tr class="header">
1260 <th style="text-align: left;">Test name</th>
1261 <th style="text-align: left;">True if</th>
1262 </tr>
1263 </thead>
1264 <tbody>
1265 <tr class="odd">
1266 <td style="text-align: left;">containsImageHeaderBox</td>
1267 <td style="text-align: left;">Box contains required Image Header box</td>
1268 </tr>
1269 <tr class="even">
1270 <td style="text-align: left;">containsColourSpecificationBox</td>
1271 <td style="text-align: left;">Box contains required Colour Specification box</td>
1272 </tr>
1273 <tr class="odd">
1274 <td style="text-align: left;">containsBitsPerComponentBox</td>
1275 <td style="text-align: left;">Box contains Bits Per Component Box, which is required if <em>bPCSign</em> and <em>bPCDepth</em> in Image Header Box equal 1 and 128, respectively (test is skipped otherwise)</td>
1276 </tr>
1277 <tr class="even">
1278 <td style="text-align: left;">firstJP2HeaderBoxIsImageHeaderBox</td>
1279 <td style="text-align: left;">First child box is Image Header Box</td>
1280 </tr>
1281 <tr class="odd">
1282 <td style="text-align: left;">noMoreThanOneImageHeaderBox</td>
1283 <td style="text-align: left;">Box contains no more than one Image Header box</td>
1284 </tr>
1285 <tr class="even">
1286 <td style="text-align: left;">noMoreThanOneBitsPerComponentBox</td>
1287 <td style="text-align: left;">Box contains no more than one Bits Per Component box</td>
1288 </tr>
1289 <tr class="odd">
1290 <td style="text-align: left;">noMoreThanOnePaletteBox</td>
1291 <td style="text-align: left;">Box contains no more than one Palette box</td>
1292 </tr>
1293 <tr class="even">
1294 <td style="text-align: left;">noMoreThanOneComponentMappingBox</td>
1295 <td style="text-align: left;">Box contains no more than one Component Mapping box</td>
1296 </tr>
1297 <tr class="odd">
1298 <td style="text-align: left;">noMoreThanOneChannelDefinitionBox</td>
1299 <td style="text-align: left;">Box contains no more than one Channel Definition box</td>
1300 </tr>
1301 <tr class="even">
1302 <td style="text-align: left;">noMoreThanOneResolutionBox</td>
1303 <td style="text-align: left;">Box contains no more than one Resolution box</td>
1304 </tr>
1305 <tr class="odd">
1306 <td style="text-align: left;">colourSpecificationBoxesAreContiguous</td>
1307 <td style="text-align: left;">In case of multiple Colour Specification boxes, they appear contiguously in the JP2 Header box</td>
1308 </tr>
1309 <tr class="even">
1310 <td style="text-align: left;">paletteAndComponentMappingBoxesOnlyTogether</td>
1311 <td style="text-align: left;">Box contains a Palette box (only if Component Mapping box is present); box contains a Component Mapping box (only if Palette box is present)</td>
1312 </tr>
1313 </tbody>
1314 </table>
1315
1316
1317 <h2 id="image-header-box">Image Header box (child of JP2 Header box)</h2>
1318
1319
1320 <p>This box specifies the size of the image and other related fields.</p>
1321
1322
1323 <h3 id="element-name-3">Element name</h3>
1324
1325
1326 <p>imageHeaderBox</p>
1327
1328
1329 <h3 id="reported-properties-3">Reported properties</h3>
1330
1331
1332 <table>
1333 <thead>
1334 <tr class="header">
1335 <th style="text-align: left;">Property</th>
1336 <th style="text-align: left;">Description</th>
1337 </tr>
1338 </thead>
1339 <tbody>
1340 <tr class="odd">
1341 <td style="text-align: left;">height</td>
1342 <td style="text-align: left;">Image height in pixels</td>
1343 </tr>
1344 <tr class="even">
1345 <td style="text-align: left;">width</td>
1346 <td style="text-align: left;">Image width in pixels</td>
1347 </tr>
1348 <tr class="odd">
1349 <td style="text-align: left;">nC</td>
1350 <td style="text-align: left;">Number of image components</td>
1351 </tr>
1352 <tr class="even">
1353 <td style="text-align: left;">bPCSign</td>
1354 <td style="text-align: left;">Indicates whether image components are signed or unsigned</td>
1355 </tr>
1356 <tr class="odd">
1357 <td style="text-align: left;">bPCDepth</td>
1358 <td style="text-align: left;">Number of bits per component</td>
1359 </tr>
1360 <tr class="even">
1361 <td style="text-align: left;">c</td>
1362 <td style="text-align: left;">Compression type</td>
1363 </tr>
1364 <tr class="odd">
1365 <td style="text-align: left;">unkC</td>
1366 <td style="text-align: left;">Colourspace Unknown field (“yes” if colourspace of image data is unknown; “no” otherwise)</td>
1367 </tr>
1368 <tr class="even">
1369 <td style="text-align: left;">iPR</td>
1370 <td style="text-align: left;">Intellectual Property field (“yes” if image contains intellectual property rights information; “no” otherwise)</td>
1371 </tr>
1372 </tbody>
1373 </table>
1374
1375
1376 <h3 id="tests-3">Tests</h3>
1377
1378
1379 <table>
1380 <thead>
1381 <tr class="header">
1382 <th style="text-align: left;">Test name</th>
1383 <th style="text-align: left;">True if</th>
1384 </tr>
1385 </thead>
1386 <tbody>
1387 <tr class="odd">
1388 <td style="text-align: left;">boxLengthIsValid</td>
1389 <td style="text-align: left;">Size of box contents equals 14 bytes</td>
1390 </tr>
1391 <tr class="even">
1392 <td style="text-align: left;">heightIsValid</td>
1393 <td style="text-align: left;"><em>height</em> is within range [1, 2<sup>32</sup> - 1]</td>
1394 </tr>
1395 <tr class="odd">
1396 <td style="text-align: left;">widthIsValid</td>
1397 <td style="text-align: left;"><em>width</em> is within range [1, 2<sup>32</sup> - 1]</td>
1398 </tr>
1399 <tr class="even">
1400 <td style="text-align: left;">nCIsValid</td>
1401 <td style="text-align: left;"><em>nC</em> is within range [1, 16384]</td>
1402 </tr>
1403 <tr class="odd">
1404 <td style="text-align: left;">bPCIsValid</td>
1405 <td style="text-align: left;"><em>bPCDepth</em> is within range [1,38] OR <em>bPCSign</em> equals 255 (in the latter case the bit depth is variable)</td>
1406 </tr>
1407 <tr class="even">
1408 <td style="text-align: left;">cIsValid</td>
1409 <td style="text-align: left;"><em>c</em> equals 7 (“jpeg2000”)</td>
1410 </tr>
1411 <tr class="odd">
1412 <td style="text-align: left;">unkCIsValid</td>
1413 <td style="text-align: left;"><em>unkC</em> equals 0 (“no”) or 1 (“yes”)</td>
1414 </tr>
1415 <tr class="even">
1416 <td style="text-align: left;">iPRIsValid</td>
1417 <td style="text-align: left;"><em>iPR</em> equals 0 (“no”) or 1 (“yes”)</td>
1418 </tr>
1419 </tbody>
1420 </table>
1421
1422
1423 <h2 id="bits-per-component-box">Bits Per Component box (child of JP2 Header box)</h2>
1424
1425
1426 <p>This (optional) box specifies the bit depth of the components in the file in cases where the bit depth is not constant across all components.</p>
1427
1428
1429 <h3 id="element-name-4">Element name</h3>
1430
1431
1432 <p>bitsPerComponentBox</p>
1433
1434
1435 <h3 id="reported-properties-4">Reported properties</h3>
1436
1437
1438 <table>
1439 <thead>
1440 <tr class="header">
1441 <th style="text-align: left;">Property</th>
1442 <th style="text-align: left;">Description</th>
1443 </tr>
1444 </thead>
1445 <tbody>
1446 <tr class="odd">
1447 <td style="text-align: left;">bPCSign<sup>*</sup></td>
1448 <td style="text-align: left;">Indicates whether image component is signed or unsigned (repeated for all components)</td>
1449 </tr>
1450 <tr class="even">
1451 <td style="text-align: left;">bPCDepth<sup>*</sup></td>
1452 <td style="text-align: left;">Number of bits for this component (repeated for all components)</td>
1453 </tr>
1454 </tbody>
1455 </table>
1456
1457
1458 <h3 id="tests-4">Tests</h3>
1459
1460
1461 <table>
1462 <thead>
1463 <tr class="header">
1464 <th style="text-align: left;">Test name</th>
1465 <th style="text-align: left;">True if</th>
1466 </tr>
1467 </thead>
1468 <tbody>
1469 <tr class="odd">
1470 <td style="text-align: left;">bPCIsValid<sup>*</sup></td>
1471 <td style="text-align: left;"><em>bPCDepth</em> is within range [1,38] (repeated for all components)</td>
1472 </tr>
1473 </tbody>
1474 </table>
1475
1476
1477 <h2 id="colour-specification-box">Colour Specification box (child of JP2 Header box)</h2>
1478
1479
1480 <p>This box specifies the colourspace of the image.</p>
1481
1482
1483 <h3 id="element-name-5">Element name</h3>
1484
1485
1486 <p>colourSpecificationBox</p>
1487
1488
1489 <h3 id="reported-properties-5">Reported properties</h3>
1490
1491
1492 <table>
1493 <thead>
1494 <tr class="header">
1495 <th style="text-align: left;">Property</th>
1496 <th style="text-align: left;">Description</th>
1497 </tr>
1498 </thead>
1499 <tbody>
1500 <tr class="odd">
1501 <td style="text-align: left;">meth</td>
1502 <td style="text-align: left;">Specification method. Indicates whether colourspace of this image is defined as an enumerated colourspace or using a (restricted) ICC profile.</td>
1503 </tr>
1504 <tr class="even">
1505 <td style="text-align: left;">prec</td>
1506 <td style="text-align: left;">Precedence</td>
1507 </tr>
1508 <tr class="odd">
1509 <td style="text-align: left;">approx</td>
1510 <td style="text-align: left;">Colourspace approximation</td>
1511 </tr>
1512 <tr class="even">
1513 <td style="text-align: left;">enumCS (if meth equals “Enumerated”)</td>
1514 <td style="text-align: left;">Enumerated colourspace (as descriptive text string)</td>
1515 </tr>
1516 <tr class="odd">
1517 <td style="text-align: left;">icc (if meth equals “Restricted ICC” or “Any ICC”<a href="#fn4" class="footnote-ref" id="fnref4" role="doc-noteref"><sup>4</sup></a>)</td>
1518 <td style="text-align: left;">Properties of ICC profile as child element (see below)</td>
1519 </tr>
1520 </tbody>
1521 </table>
1522
1523
1524 <h3 id="reported-properties-of-icc-profiles">Reported properties of ICC profiles</h3>
1525
1526
1527 <p>If the colour specification box contains an embedded ICC profile, <em>jpylyzer</em> will also report the following properties (which are all grouped in an “icc” sub-element in the properties tree). An exhaustive explanation of these properties is given in the ICC specification (ISO 15076-1 / ICC.1:2004-10). Note that <em>jpylyzer</em> does <em>not</em> validate embedded ICC profiles (even though it does check if a specific ICC profile is allowed in JP2)!</p>
1528
1529
1530 <table>
1531 <thead>
1532 <tr class="header">
1533 <th style="text-align: left;">Property</th>
1534 <th style="text-align: left;">Description</th>
1535 </tr>
1536 </thead>
1537 <tbody>
1538 <tr class="odd">
1539 <td style="text-align: left;">profileSize</td>
1540 <td style="text-align: left;">Size of ICC profile in bytes</td>
1541 </tr>
1542 <tr class="even">
1543 <td style="text-align: left;">preferredCMMType</td>
1544 <td style="text-align: left;">Preferred CMM type</td>
1545 </tr>
1546 <tr class="odd">
1547 <td style="text-align: left;">profileVersion</td>
1548 <td style="text-align: left;">Profile version. Format: “majorRevision.minorRevision.bugFixRevision”</td>
1549 </tr>
1550 <tr class="even">
1551 <td style="text-align: left;">profileClass</td>
1552 <td style="text-align: left;">Profile/device class</td>
1553 </tr>
1554 <tr class="odd">
1555 <td style="text-align: left;">colourSpace</td>
1556 <td style="text-align: left;">Colourspace</td>
1557 </tr>
1558 <tr class="even">
1559 <td style="text-align: left;">profileConnectionSpace</td>
1560 <td style="text-align: left;">Profile connection space</td>
1561 </tr>
1562 <tr class="odd">
1563 <td style="text-align: left;">dateTimeString</td>
1564 <td style="text-align: left;">Date / time string. Format: “YYYY/MM/DD, h:m:s”</td>
1565 </tr>
1566 <tr class="even">
1567 <td style="text-align: left;">profileSignature</td>
1568 <td style="text-align: left;">Profile signature</td>
1569 </tr>
1570 <tr class="odd">
1571 <td style="text-align: left;">primaryPlatform</td>
1572 <td style="text-align: left;">Primary platform</td>
1573 </tr>
1574 <tr class="even">
1575 <td style="text-align: left;">embeddedProfile</td>
1576 <td style="text-align: left;">Flag that indicates whether profile is embedded in file (“yes”/”no”)</td>
1577 </tr>
1578 <tr class="odd">
1579 <td style="text-align: left;">profileCannotBeUsedIndependently</td>
1580 <td style="text-align: left;">Flag that indicates whether profile can<em>not</em> (!) be used independently from the embedded colour data (“yes”/”no”)</td>
1581 </tr>
1582 <tr class="even">
1583 <td style="text-align: left;">deviceManufacturer</td>
1584 <td style="text-align: left;">Identifies a device manufacturer</td>
1585 </tr>
1586 <tr class="odd">
1587 <td style="text-align: left;">deviceModel</td>
1588 <td style="text-align: left;">Identifies a device model</td>
1589 </tr>
1590 <tr class="even">
1591 <td style="text-align: left;">transparency</td>
1592 <td style="text-align: left;">Indicates whether device medium is reflective or transparent</td>
1593 </tr>
1594 <tr class="odd">
1595 <td style="text-align: left;">glossiness</td>
1596 <td style="text-align: left;">Indicates whether device medium is glossy or matte</td>
1597 </tr>
1598 <tr class="even">
1599 <td style="text-align: left;">polarity</td>
1600 <td style="text-align: left;">Indicates whether device medium is positive or negative</td>
1601 </tr>
1602 <tr class="odd">
1603 <td style="text-align: left;">colour</td>
1604 <td style="text-align: left;">Indicates whether device medium is colour or black and white</td>
1605 </tr>
1606 <tr class="even">
1607 <td style="text-align: left;">renderingIntent</td>
1608 <td style="text-align: left;">Rendering intent</td>
1609 </tr>
1610 <tr class="odd">
1611 <td style="text-align: left;">connectionSpaceIlluminantX</td>
1612 <td style="text-align: left;">Profile connection space illuminant X</td>
1613 </tr>
1614 <tr class="even">
1615 <td style="text-align: left;">connectionSpaceIlluminantY</td>
1616 <td style="text-align: left;">Profile connection space illuminant Y</td>
1617 </tr>
1618 <tr class="odd">
1619 <td style="text-align: left;">connectionSpaceIlluminantZ</td>
1620 <td style="text-align: left;">Profile connection space illuminant Z</td>
1621 </tr>
1622 <tr class="even">
1623 <td style="text-align: left;">profileCreator</td>
1624 <td style="text-align: left;">Identifies creator of profile</td>
1625 </tr>
1626 <tr class="odd">
1627 <td style="text-align: left;">profileID</td>
1628 <td style="text-align: left;">Profile checksum (as hexadecimal string)</td>
1629 </tr>
1630 <tr class="even">
1631 <td style="text-align: left;">tag<sup>*</sup></td>
1632 <td style="text-align: left;">Signature of profile tag (repeated for all tags in the profile)</td>
1633 </tr>
1634 <tr class="odd">
1635 <td style="text-align: left;">description</td>
1636 <td style="text-align: left;">Profile description (extracted from ‘desc’ tag)</td>
1637 </tr>
1638 </tbody>
1639 </table>
1640
1641
1642 <h3 id="tests-5">Tests</h3>
1643
1644
1645 <table>
1646 <thead>
1647 <tr class="header">
1648 <th style="text-align: left;">Test name</th>
1649 <th style="text-align: left;">True if</th>
1650 </tr>
1651 </thead>
1652 <tbody>
1653 <tr class="odd">
1654 <td style="text-align: left;">methIsValid</td>
1655 <td style="text-align: left;"><em>meth</em> equals 1 (enumerated colourspace) or 2 (restricted ICC profile)</td>
1656 </tr>
1657 <tr class="even">
1658 <td style="text-align: left;">precIsValid</td>
1659 <td style="text-align: left;"><em>prec</em> equals 0</td>
1660 </tr>
1661 <tr class="odd">
1662 <td style="text-align: left;">approxIsValid</td>
1663 <td style="text-align: left;"><em>approx</em> equals 0</td>
1664 </tr>
1665 <tr class="even">
1666 <td style="text-align: left;">enumCSIsValid (if meth equals “Enumerated”)</td>
1667 <td style="text-align: left;"><em>enumCS</em> equals 16 (“sRGB”), 17 (“greyscale”) or 18 (“sYCC”)</td>
1668 </tr>
1669 <tr class="odd">
1670 <td style="text-align: left;">iccSizeIsValid (if meth equals “Restricted ICC”)</td>
1671 <td style="text-align: left;">Actual size of embedded ICC profile equals value of profileSize field in ICC header</td>
1672 </tr>
1673 <tr class="even">
1674 <td style="text-align: left;">iccPermittedProfileClass (if meth equals “Restricted ICC”)</td>
1675 <td style="text-align: left;">ICC profile class is “input device” or “display device”<a href="#fn5" class="footnote-ref" id="fnref5" role="doc-noteref"><sup>5</sup></a></td>
1676 </tr>
1677 <tr class="odd">
1678 <td style="text-align: left;">iccNoLUTBasedProfile (if meth equals “Restricted ICC”)</td>
1679 <td style="text-align: left;">ICC profile type is not N-component LUT based (which is not allowed in JP2)</td>
1680 </tr>
1681 </tbody>
1682 </table>
1683
1684
1685 <h2 id="palette-box">Palette box (child of JP2 Header box)</h2>
1686
1687
1688 <p>This (optional) box specifies the palette which maps a single component in index space to a multiple-component image.</p>
1689
1690
1691 <h3 id="element-name-6">Element name</h3>
1692
1693
1694 <p>paletteBox</p>
1695
1696
1697 <h3 id="reported-properties-6">Reported properties</h3>
1698
1699
1700 <table>
1701 <thead>
1702 <tr class="header">
1703 <th style="text-align: left;">Property</th>
1704 <th style="text-align: left;">Description</th>
1705 </tr>
1706 </thead>
1707 <tbody>
1708 <tr class="odd">
1709 <td style="text-align: left;">nE</td>
1710 <td style="text-align: left;">Number of entries in the table</td>
1711 </tr>
1712 <tr class="even">
1713 <td style="text-align: left;">nPC</td>
1714 <td style="text-align: left;">Number of palette columns</td>
1715 </tr>
1716 <tr class="odd">
1717 <td style="text-align: left;">bSign<sup>*</sup></td>
1718 <td style="text-align: left;">Indicates whether values created by this palette column are signed or unsigned (repeated for all columns)</td>
1719 </tr>
1720 <tr class="even">
1721 <td style="text-align: left;">bDepth<sup>*</sup></td>
1722 <td style="text-align: left;">Bit depth of values created by this palette column (repeated for all columns)</td>
1723 </tr>
1724 <tr class="odd">
1725 <td style="text-align: left;">cP<sup>**</sup></td>
1726 <td style="text-align: left;">Value for this entry (repeated for all columns, and for the number of entries)</td>
1727 </tr>
1728 </tbody>
1729 </table>
1730
1731
1732 <h3 id="tests-6">Tests</h3>
1733
1734
1735 <table>
1736 <thead>
1737 <tr class="header">
1738 <th style="text-align: left;">Test name</th>
1739 <th style="text-align: left;">True if</th>
1740 </tr>
1741 </thead>
1742 <tbody>
1743 <tr class="odd">
1744 <td style="text-align: left;">nEIsValid</td>
1745 <td style="text-align: left;"><em>nE</em> is within range [0,1024]</td>
1746 </tr>
1747 <tr class="even">
1748 <td style="text-align: left;">nPCIsValid</td>
1749 <td style="text-align: left;"><em>nPC</em> is within range [1,255]</td>
1750 </tr>
1751 <tr class="odd">
1752 <td style="text-align: left;">bDepthIsValid<sup>*</sup></td>
1753 <td style="text-align: left;"><em>bDepth</em> is within range [1,38] (repeated for all columns)</td>
1754 </tr>
1755 </tbody>
1756 </table>
1757
1758
1759 <h2 id="component-mapping-box">Component Mapping box (child of JP2 Header box)</h2>
1760
1761
1762 <p>This (optional) box specifies the mapping between a palette and codestream components.</p>
1763
1764
1765 <h3 id="element-name-7">Element name</h3>
1766
1767
1768 <p>componentMappingBox</p>
1769
1770
1771 <h3 id="reported-properties-7">Reported properties</h3>
1772
1773
1774 <table>
1775 <thead>
1776 <tr class="header">
1777 <th style="text-align: left;">Property</th>
1778 <th style="text-align: left;">Description</th>
1779 </tr>
1780 </thead>
1781 <tbody>
1782 <tr class="odd">
1783 <td style="text-align: left;">cMP<sup>*</sup></td>
1784 <td style="text-align: left;">Component index (repeated for all channels)</td>
1785 </tr>
1786 <tr class="even">
1787 <td style="text-align: left;">mTyp<sup>*</sup></td>
1788 <td style="text-align: left;">Specifies how channel is generated from codestream component (repeated for all channels)</td>
1789 </tr>
1790 <tr class="odd">
1791 <td style="text-align: left;">pCol<sup>*</sup></td>
1792 <td style="text-align: left;">Palette component index (repeated for all channels)</td>
1793 </tr>
1794 </tbody>
1795 </table>
1796
1797
1798 <h3 id="tests-7">Tests</h3>
1799
1800
1801 <table>
1802 <thead>
1803 <tr class="header">
1804 <th style="text-align: left;">Test name</th>
1805 <th style="text-align: left;">True if</th>
1806 </tr>
1807 </thead>
1808 <tbody>
1809 <tr class="odd">
1810 <td style="text-align: left;">cMPIsValid</td>
1811 <td style="text-align: left;"><em>cMP</em> is within range [0,16384]</td>
1812 </tr>
1813 <tr class="even">
1814 <td style="text-align: left;">mTypIsValid<sup>*</sup></td>
1815 <td style="text-align: left;"><em>mTyp</em> is within range [0,1] (repeated for all channels)</td>
1816 </tr>
1817 <tr class="odd">
1818 <td style="text-align: left;">pColIsValid<sup>*</sup></td>
1819 <td style="text-align: left;"><em>pCol</em> is 0 if <em>mTyp</em> is 0 (repeated for all channels)</td>
1820 </tr>
1821 </tbody>
1822 </table>
1823
1824
1825 <h2 id="channel-definition-box">Channel Definition box (child of JP2 Header box)</h2>
1826
1827
1828 <p>This (optional) box specifies the type and ordering of the components within the codestream, as well as those created by the application of a palette.</p>
1829
1830
1831 <h3 id="element-name-8">Element name</h3>
1832
1833
1834 <p>channelDefinitionBox</p>
1835
1836
1837 <h3 id="reported-properties-8">Reported properties</h3>
1838
1839
1840 <table>
1841 <thead>
1842 <tr class="header">
1843 <th style="text-align: left;">Property</th>
1844 <th style="text-align: left;">Description</th>
1845 </tr>
1846 </thead>
1847 <tbody>
1848 <tr class="odd">
1849 <td style="text-align: left;">n</td>
1850 <td style="text-align: left;">Number of channel descriptions</td>
1851 </tr>
1852 <tr class="even">
1853 <td style="text-align: left;">cN<sup>*</sup></td>
1854 <td style="text-align: left;">Channel index (repeated for all channels)</td>
1855 </tr>
1856 <tr class="odd">
1857 <td style="text-align: left;">cTyp<sup>*</sup></td>
1858 <td style="text-align: left;">Channel type (repeated for all channels)</td>
1859 </tr>
1860 <tr class="even">
1861 <td style="text-align: left;">cAssoc<sup>*</sup></td>
1862 <td style="text-align: left;">Channel association (repeated for all channels)</td>
1863 </tr>
1864 </tbody>
1865 </table>
1866
1867
1868 <h3 id="tests-8">Tests</h3>
1869
1870
1871 <table>
1872 <thead>
1873 <tr class="header">
1874 <th style="text-align: left;">Test name</th>
1875 <th style="text-align: left;">True if</th>
1876 </tr>
1877 </thead>
1878 <tbody>
1879 <tr class="odd">
1880 <td style="text-align: left;">nIsValid</td>
1881 <td style="text-align: left;"><em>n</em> is within range [1, 65535]</td>
1882 </tr>
1883 <tr class="even">
1884 <td style="text-align: left;">boxLengthIsValid</td>
1885 <td style="text-align: left;">(Size of box – 2) / equals 6*<em>n</em></td>
1886 </tr>
1887 <tr class="odd">
1888 <td style="text-align: left;">cNIsValid<sup>*</sup></td>
1889 <td style="text-align: left;"><em>cN</em> is within range [0, 65535] (repeated for all channels)</td>
1890 </tr>
1891 <tr class="even">
1892 <td style="text-align: left;">cTypIsValid<sup>*</sup></td>
1893 <td style="text-align: left;"><em>cType</em> is within range [0, 65535] (repeated for all channels)</td>
1894 </tr>
1895 <tr class="odd">
1896 <td style="text-align: left;">cAssocIsValid<sup>*</sup></td>
1897 <td style="text-align: left;"><em>cAssoc</em> is within range [0, 65535] (repeated for all channels)</td>
1898 </tr>
1899 </tbody>
1900 </table>
1901
1902
1903 <h2 id="resolution-box">Resolution box (child of JP2 Header box, superbox)</h2>
1904
1905
1906 <p>This (optional) box contains the grid resolution.</p>
1907
1908
1909 <h3 id="element-name-9">Element name</h3>
1910
1911
1912 <p>resolutionBox</p>
1913
1914
1915 <h3 id="reported-properties-9">Reported properties</h3>
1916
1917
1918 <p>Since this is a superbox, it contains one or two child boxes. These are represented as child elements in the properties tree:</p>
1919
1920
1921 <table>
1922 <thead>
1923 <tr class="header">
1924 <th style="text-align: left;">Child element</th>
1925 <th style="text-align: left;">Description</th>
1926 </tr>
1927 </thead>
1928 <tbody>
1929 <tr class="odd">
1930 <td style="text-align: left;"><a href="#capture-resolution-box">captureResolutionBox</a></td>
1931 <td style="text-align: left;">Properties from Capture Resolution box</td>
1932 </tr>
1933 <tr class="even">
1934 <td style="text-align: left;"><a href="#display-resolution-box">displayResolutionBox</a></td>
1935 <td style="text-align: left;">Properties from Default Display Resolution box</td>
1936 </tr>
1937 </tbody>
1938 </table>
1939
1940
1941 <h3 id="tests-9">Tests</h3>
1942
1943
1944 <table>
1945 <thead>
1946 <tr class="header">
1947 <th style="text-align: left;">Test name</th>
1948 <th style="text-align: left;">True if</th>
1949 </tr>
1950 </thead>
1951 <tbody>
1952 <tr class="odd">
1953 <td style="text-align: left;">containsCaptureOrDisplayResolutionBox</td>
1954 <td style="text-align: left;">Box contains either a Capture Resolution box or a Default Display Resolution box, or both</td>
1955 </tr>
1956 <tr class="even">
1957 <td style="text-align: left;">noMoreThanOneCaptureResolutionBox</td>
1958 <td style="text-align: left;">Box contains no more than one Capture Resolution box</td>
1959 </tr>
1960 <tr class="odd">
1961 <td style="text-align: left;">noMoreThanOneDisplayResolutionBox</td>
1962 <td style="text-align: left;">Box contains no more than one Default Display Resolution box</td>
1963 </tr>
1964 </tbody>
1965 </table>
1966
1967
1968 <h2 id="capture-resolution-box">Capture Resolution box (child of Resolution box)</h2>
1969
1970
1971 <p>This (optional) box specifies the grid resolution at which the image was captured.</p>
1972
1973
1974 <h3 id="element-name-10">Element name</h3>
1975
1976
1977 <p>captureResolutionBox</p>
1978
1979
1980 <h3 id="reported-properties-10">Reported properties</h3>
1981
1982
1983 <p>Resolution information in this box is stored as a set of vertical and horizontal numerators, denominators and exponents. <em>Jpylyzer</em> also reports the corresponding grid resolutions in pixels per meter and pixels per inch, which are calculated from these values.</p>
1984
1985
1986 <table>
1987 <thead>
1988 <tr class="header">
1989 <th style="text-align: left;">Property</th>
1990 <th style="text-align: left;">Description</th>
1991 </tr>
1992 </thead>
1993 <tbody>
1994 <tr class="odd">
1995 <td style="text-align: left;">vRcN</td>
1996 <td style="text-align: left;">Vertical grid resolution numerator</td>
1997 </tr>
1998 <tr class="even">
1999 <td style="text-align: left;">vRcD</td>
2000 <td style="text-align: left;">Vertical grid resolution denominator</td>
2001 </tr>
2002 <tr class="odd">
2003 <td style="text-align: left;">hRcN</td>
2004 <td style="text-align: left;">Horizontal grid resolution numerator</td>
2005 </tr>
2006 <tr class="even">
2007 <td style="text-align: left;">hRcD</td>
2008 <td style="text-align: left;">Horizontal grid resolution denominator</td>
2009 </tr>
2010 <tr class="odd">
2011 <td style="text-align: left;">vRcE</td>
2012 <td style="text-align: left;">Vertical grid resolution exponent</td>
2013 </tr>
2014 <tr class="even">
2015 <td style="text-align: left;">hRcE</td>
2016 <td style="text-align: left;">Horizontal grid resolution exponent</td>
2017 </tr>
2018 <tr class="odd">
2019 <td style="text-align: left;">vRescInPixelsPerMeter</td>
2020 <td style="text-align: left;">Vertical grid resolution, expressed in pixels per meter<a href="#fn6" class="footnote-ref" id="fnref6" role="doc-noteref"><sup>6</sup></a></td>
2021 </tr>
2022 <tr class="even">
2023 <td style="text-align: left;">hRescInPixelsPerMeter</td>
2024 <td style="text-align: left;">Horizontal grid resolution, expressed in pixels per meter<a href="#fn7" class="footnote-ref" id="fnref7" role="doc-noteref"><sup>7</sup></a></td>
2025 </tr>
2026 <tr class="odd">
2027 <td style="text-align: left;">vRescInPixelsPerInch</td>
2028 <td style="text-align: left;">Vertical grid resolution, expressed in pixels per inch<a href="#fn8" class="footnote-ref" id="fnref8" role="doc-noteref"><sup>8</sup></a></td>
2029 </tr>
2030 <tr class="even">
2031 <td style="text-align: left;">hRescInPixelsPerInch</td>
2032 <td style="text-align: left;">Horizontal grid resolution, expressed in pixels per inch<a href="#fn9" class="footnote-ref" id="fnref9" role="doc-noteref"><sup>9</sup></a></td>
2033 </tr>
2034 </tbody>
2035 </table>
2036
2037
2038 <h3 id="tests-10">Tests</h3>
2039
2040
2041 <table>
2042 <thead>
2043 <tr class="header">
2044 <th style="text-align: left;">Test name</th>
2045 <th style="text-align: left;">True if</th>
2046 </tr>
2047 </thead>
2048 <tbody>
2049 <tr class="odd">
2050 <td style="text-align: left;">boxLengthIsValid</td>
2051 <td style="text-align: left;">Size of box contents equals 10 bytes</td>
2052 </tr>
2053 <tr class="even">
2054 <td style="text-align: left;">vRcNIsValid</td>
2055 <td style="text-align: left;"><em>vRcN</em> is within range [1,65535]</td>
2056 </tr>
2057 <tr class="odd">
2058 <td style="text-align: left;">vRcDIsValid</td>
2059 <td style="text-align: left;"><em>vRcD</em> is within range [1,65535]</td>
2060 </tr>
2061 <tr class="even">
2062 <td style="text-align: left;">hRcNIsValid</td>
2063 <td style="text-align: left;"><em>hRcN</em> is within range [1,65535]</td>
2064 </tr>
2065 <tr class="odd">
2066 <td style="text-align: left;">hRcDIsValid</td>
2067 <td style="text-align: left;"><em>hRcD</em> is within range [1,65535]</td>
2068 </tr>
2069 <tr class="even">
2070 <td style="text-align: left;">vRcEIsValid</td>
2071 <td style="text-align: left;"><em>vRcE</em> is within range [-127,128]</td>
2072 </tr>
2073 <tr class="odd">
2074 <td style="text-align: left;">hRcEIsValid</td>
2075 <td style="text-align: left;"><em>hRcE</em> is within range [-127,128]</td>
2076 </tr>
2077 </tbody>
2078 </table>
2079
2080
2081 <h2 id="display-resolution-box">Default Display Resolution box (child of Resolution box)</h2>
2082
2083
2084 <p>This (optional) box specifies the default grid resolution at which the image should be displayed.</p>
2085
2086
2087 <h3 id="element-name-11">Element name</h3>
2088
2089
2090 <p>displayResolutionBox</p>
2091
2092
2093 <h3 id="reported-properties-11">Reported properties</h3>
2094
2095
2096 <p>Resolution information in this box is stored as a set of vertical and horizontal numerators, denominators and exponents. <em>Jpylyzer</em> also reports the corresponding grid resolutions in pixels per meter and pixels per inch, which are calculated from these values.</p>
2097
2098
2099 <table>
2100 <thead>
2101 <tr class="header">
2102 <th style="text-align: left;">Property</th>
2103 <th style="text-align: left;">Description</th>
2104 </tr>
2105 </thead>
2106 <tbody>
2107 <tr class="odd">
2108 <td style="text-align: left;">vRdN</td>
2109 <td style="text-align: left;">Vertical grid resolution numerator</td>
2110 </tr>
2111 <tr class="even">
2112 <td style="text-align: left;">vRdD</td>
2113 <td style="text-align: left;">Vertical grid resolution denominator</td>
2114 </tr>
2115 <tr class="odd">
2116 <td style="text-align: left;">hRdN</td>
2117 <td style="text-align: left;">Horizontal grid resolution numerator</td>
2118 </tr>
2119 <tr class="even">
2120 <td style="text-align: left;">hRdD</td>
2121 <td style="text-align: left;">Horizontal grid resolution denominator</td>
2122 </tr>
2123 <tr class="odd">
2124 <td style="text-align: left;">vRdE</td>
2125 <td style="text-align: left;">Vertical grid resolution exponent</td>
2126 </tr>
2127 <tr class="even">
2128 <td style="text-align: left;">hRdE</td>
2129 <td style="text-align: left;">Horizontal grid resolution exponent</td>
2130 </tr>
2131 <tr class="odd">
2132 <td style="text-align: left;">vResdInPixelsPerMeter</td>
2133 <td style="text-align: left;">Vertical grid resolution, expressed in pixels per meter<a href="#fn10" class="footnote-ref" id="fnref10" role="doc-noteref"><sup>10</sup></a></td>
2134 </tr>
2135 <tr class="even">
2136 <td style="text-align: left;">hResdInPixelsPerMeter</td>
2137 <td style="text-align: left;">Horizontal grid resolution, expressed in pixels per meter<a href="#fn11" class="footnote-ref" id="fnref11" role="doc-noteref"><sup>11</sup></a></td>
2138 </tr>
2139 <tr class="odd">
2140 <td style="text-align: left;">vResdInPixelsPerInch</td>
2141 <td style="text-align: left;">Vertical grid resolution, expressed in pixels per inch<a href="#fn12" class="footnote-ref" id="fnref12" role="doc-noteref"><sup>12</sup></a></td>
2142 </tr>
2143 <tr class="even">
2144 <td style="text-align: left;">hResdInPixelsPerInch</td>
2145 <td style="text-align: left;">Horizontal grid resolution, expressed in pixels per inch<a href="#fn13" class="footnote-ref" id="fnref13" role="doc-noteref"><sup>13</sup></a></td>
2146 </tr>
2147 </tbody>
2148 </table>
2149
2150
2151 <h3 id="tests-11">Tests</h3>
2152
2153
2154 <table>
2155 <thead>
2156 <tr class="header">
2157 <th style="text-align: left;">Test name</th>
2158 <th style="text-align: left;">True if</th>
2159 </tr>
2160 </thead>
2161 <tbody>
2162 <tr class="odd">
2163 <td style="text-align: left;">boxLengthIsValid</td>
2164 <td style="text-align: left;">Size of box contents equals 10 bytes</td>
2165 </tr>
2166 <tr class="even">
2167 <td style="text-align: left;">vRdNIsValid</td>
2168 <td style="text-align: left;"><em>vRdN</em> is within range [1,65535]</td>
2169 </tr>
2170 <tr class="odd">
2171 <td style="text-align: left;">vRdDIsValid</td>
2172 <td style="text-align: left;"><em>vRdD</em> is within range [1,65535]</td>
2173 </tr>
2174 <tr class="even">
2175 <td style="text-align: left;">hRdNIsValid</td>
2176 <td style="text-align: left;"><em>hRdN</em> is within range [1,65535]</td>
2177 </tr>
2178 <tr class="odd">
2179 <td style="text-align: left;">hRdDIsValid</td>
2180 <td style="text-align: left;"><em>hRdD</em> is within range [1,65535]</td>
2181 </tr>
2182 <tr class="even">
2183 <td style="text-align: left;">vRdEIsValid</td>
2184 <td style="text-align: left;"><em>vRdE</em> is within range [-127,128]</td>
2185 </tr>
2186 <tr class="odd">
2187 <td style="text-align: left;">hRdEIsValid</td>
2188 <td style="text-align: left;"><em>hRdE</em> is within range [-127,128]</td>
2189 </tr>
2190 </tbody>
2191 </table>
2192
2193
2194 <h2 id="codestream-box">Contiguous Codestream box</h2>
2195
2196
2197 <p>This box contains the codestream. See <a href="#contiguous-codestream-box-chapter">here</a>.</p>
2198
2199
2200 <h2 id="intellectual-property-box">Intellectual Property box</h2>
2201
2202
2203 <p>This (optional) box contains intellectual property information about the image. The JP2 format specification (ISO/IEC 15444-1) does not provide any specific information about this box, other than stating that “the definition of the format of [its] contents […] is reserved for ISO”. As a result, <em>jpylyzer</em> does not currently include a validator function for this box, which is now simply ignored. <em>Jpylyzer</em> will display a user warning message in that case.</p>
2204
2205
2206 <h2 id="xml-box">XML box</h2>
2207
2208
2209 <p>This (optional) box contains XML formatted information.</p>
2210
2211
2212 <h3 id="element-name-12">Element name</h3>
2213
2214
2215 <p>xmlBox</p>
2216
2217
2218 <h3 id="reported-properties-12">Reported properties</h3>
2219
2220
2221 <p>If the contents of this box are well-formed XML (see ‘tests’ below), the ‘xmlBox’ element in the properties tree will contain the contents of the XML box. Note that, depending on the character encoding of the original XML, it may contain characters that are not allowed in the encoding that is used for <em>jpylyzer</em>’s output. Any such characters will be represented by numerical entity references in the output. If the box contents are not well-formed XML, no properties are reported for this box.</p>
2222
2223
2224 <h3 id="tests-12">Tests</h3>
2225
2226
2227 <table>
2228 <thead>
2229 <tr class="header">
2230 <th style="text-align: left;">Test name</th>
2231 <th style="text-align: left;">True if</th>
2232 </tr>
2233 </thead>
2234 <tbody>
2235 <tr class="odd">
2236 <td style="text-align: left;">containsWellformedXML</td>
2237 <td style="text-align: left;">Contents of box are parsable, well-formed XML</td>
2238 </tr>
2239 </tbody>
2240 </table>
2241
2242
2243 <p>Note that <em>jpylyzer</em> does not check whether the XML is <em>valid</em>, as this is not required by the standard. Besides, doing so would make <em>jpylyzer</em> significantly slower for XML that contains references to external schemas and DTDs.</p>
2244
2245
2246 <h2 id="uuid-box">UUID box</h2>
2247
2248
2249 <p>This (optional) box contains additional (binary) information, which may be vendor-specific. Some applications (e.g. Kakadu and ExifTool) also use this box for storing XMP metadata (see Section 1.1.4 in Part 3 of the XMP specification<a href="#fn14" class="footnote-ref" id="fnref14" role="doc-noteref"><sup>14</sup></a>).</p>
2250
2251
2252 <h3 id="element-name-13">Element name</h3>
2253
2254
2255 <p>uuidBox</p>
2256
2257
2258 <h3 id="reported-properties-13">Reported properties</h3>
2259
2260
2261 <p>If the value of <em>uuid</em> indicates the presence of XMP metadata and the contents of this box are well-formed XML, (see ‘tests’ below), the ‘uuidBox’ element in the properties tree will contain the XMP data. Note that, depending on the character encoding of the original XML, it may contain characters that are not allowed in the encoding that is used for <em>jpylyzer</em>’s output. Any such characters will be represented by numerical entity references in the output. In all other cases, the ‘uuidBox’ element will contain a standard string representation the of UUID.</p>
2262
2263
2264 <table>
2265 <thead>
2266 <tr class="header">
2267 <th style="text-align: left;">Property</th>
2268 <th style="text-align: left;">Description</th>
2269 </tr>
2270 </thead>
2271 <tbody>
2272 <tr class="odd">
2273 <td style="text-align: left;">uuid</td>
2274 <td style="text-align: left;">Standard string representation of UUID (<strong>only</strong> if uuid has value other than <em>be7acfcb-97a9-42e8-9c71-999491e3afac</em>). For an explanation of UUIDs see e.g. Leach <em>et al</em>., 2005.</td>
2275 </tr>
2276 <tr class="even">
2277 <td style="text-align: left;">XMP data</td>
2278 <td style="text-align: left;">XMP metadata (<strong>only</strong> if uuid has value <em>be7acfcb-97a9-42e8-9c71-999491e3afac</em>)</td>
2279 </tr>
2280 </tbody>
2281 </table>
2282
2283
2284 <p>Note that except for the XMP case, <em>jpylyzer</em> will not be able to report any information on the actual contents of this box, since it is defined outside of the scope of JPEG 2000.</p>
2285
2286
2287 <h3 id="tests-13">Tests</h3>
2288
2289
2290 <table>
2291 <thead>
2292 <tr class="header">
2293 <th style="text-align: left;">Test name</th>
2294 <th style="text-align: left;">True if</th>
2295 </tr>
2296 </thead>
2297 <tbody>
2298 <tr class="odd">
2299 <td style="text-align: left;">boxLengthIsValid</td>
2300 <td style="text-align: left;">Size of box contents is greater than 16 bytes</td>
2301 </tr>
2302 <tr class="even">
2303 <td style="text-align: left;">containsWellformedXML</td>
2304 <td style="text-align: left;">Contents of box are parsable, well-formed XML (this test is <strong>only</strong> performed if uuid has value <em>be7acfcb-97a9-42e8-9c71-999491e3afac</em>)</td>
2305 </tr>
2306 </tbody>
2307 </table>
2308
2309
2310 <h2 id="uuid-info-box">UUID Info box (superbox)</h2>
2311
2312
2313 <p>This (optional) box contains additional information associated with a UUID.</p>
2314
2315
2316 <h3 id="element-name-14">Element name</h3>
2317
2318
2319 <p>uuidInfoBox</p>
2320
2321
2322 <h3 id="reported-properties-14">Reported properties</h3>
2323
2324
2325 <p>This is a superbox which contains two child boxes. These are represented as child elements in the properties tree:</p>
2326
2327
2328 <table>
2329 <thead>
2330 <tr class="header">
2331 <th style="text-align: left;">Child element</th>
2332 <th style="text-align: left;">Description</th>
2333 </tr>
2334 </thead>
2335 <tbody>
2336 <tr class="odd">
2337 <td style="text-align: left;"><a href="#uuid-list-box">uuidListBox</a></td>
2338 <td style="text-align: left;">Properties from UUID List box</td>
2339 </tr>
2340 <tr class="even">
2341 <td style="text-align: left;"><a href="#data-entry-url-box">urlBox</a></td>
2342 <td style="text-align: left;">Properties from Data Entry URL box</td>
2343 </tr>
2344 </tbody>
2345 </table>
2346
2347
2348 <h3 id="tests-14">Tests</h3>
2349
2350
2351 <table>
2352 <thead>
2353 <tr class="header">
2354 <th style="text-align: left;">Test name</th>
2355 <th style="text-align: left;">True if</th>
2356 </tr>
2357 </thead>
2358 <tbody>
2359 <tr class="odd">
2360 <td style="text-align: left;">containsOneListBox</td>
2361 <td style="text-align: left;">Box contains exactly one UUID List box</td>
2362 </tr>
2363 <tr class="even">
2364 <td style="text-align: left;">containsOneURLBox</td>
2365 <td style="text-align: left;">Box contains exactly one Data Entry URL box</td>
2366 </tr>
2367 </tbody>
2368 </table>
2369
2370
2371 <h2 id="uuid-list-box">UUID List box (child of UUID Info box)</h2>
2372
2373
2374 <p>This (optional) box specifies a list of UUIDs.</p>
2375
2376
2377 <h3 id="element-name-15">Element name</h3>
2378
2379
2380 <p>uuidListBox</p>
2381
2382
2383 <h3 id="reported-properties-15">Reported properties</h3>
2384
2385
2386 <table>
2387 <thead>
2388 <tr class="header">
2389 <th style="text-align: left;">Property</th>
2390 <th style="text-align: left;">Description</th>
2391 </tr>
2392 </thead>
2393 <tbody>
2394 <tr class="odd">
2395 <td style="text-align: left;">nU</td>
2396 <td style="text-align: left;">Number of UUIDs</td>
2397 </tr>
2398 <tr class="even">
2399 <td style="text-align: left;">uuid<sup>*</sup></td>
2400 <td style="text-align: left;">Standard string representation of UUID (repeated <em>nU</em> times)</td>
2401 </tr>
2402 </tbody>
2403 </table>
2404
2405
2406 <h3 id="tests-15">Tests</h3>
2407
2408
2409 <table>
2410 <thead>
2411 <tr class="header">
2412 <th style="text-align: left;">Test name</th>
2413 <th style="text-align: left;">True if</th>
2414 </tr>
2415 </thead>
2416 <tbody>
2417 <tr class="odd">
2418 <td style="text-align: left;">boxLengthIsValid</td>
2419 <td style="text-align: left;">Size of box equals <em>nU</em> * 16 + 2</td>
2420 </tr>
2421 </tbody>
2422 </table>
2423
2424
2425 <h2 id="data-entry-url-box">Data Entry URL box (child of UUID Info box)</h2>
2426
2427
2428 <p>This (optional) box specifies a URL.</p>
2429
2430
2431 <h3 id="element-name-16">Element name</h3>
2432
2433
2434 <p>urlBox</p>
2435
2436
2437 <h3 id="reported-properties-16">Reported properties</h3>
2438
2439
2440 <table>
2441 <thead>
2442 <tr class="header">
2443 <th style="text-align: left;">Property</th>
2444 <th style="text-align: left;">Description</th>
2445 </tr>
2446 </thead>
2447 <tbody>
2448 <tr class="odd">
2449 <td style="text-align: left;">version</td>
2450 <td style="text-align: left;">Version number</td>
2451 </tr>
2452 <tr class="even">
2453 <td style="text-align: left;">loc</td>
2454 <td style="text-align: left;">Location, which specifies a URL of the additional information associated with the UUIDs in the UUID List box that resides in the same UUID Info box</td>
2455 </tr>
2456 </tbody>
2457 </table>
2458
2459
2460 <h3 id="tests-16">Tests</h3>
2461
2462
2463 <table>
2464 <thead>
2465 <tr class="header">
2466 <th style="text-align: left;">Test name</th>
2467 <th style="text-align: left;">True if</th>
2468 </tr>
2469 </thead>
2470 <tbody>
2471 <tr class="odd">
2472 <td style="text-align: left;">flagIsValid</td>
2473 <td style="text-align: left;">Three bytes that make up “flag” field equal 0x00 00 00 (‘flag’ is not reported to output because it only contains null bytes)</td>
2474 </tr>
2475 <tr class="even">
2476 <td style="text-align: left;">locIsUTF8</td>
2477 <td style="text-align: left;">Location (URL) can be decoded to UTF-8</td>
2478 </tr>
2479 <tr class="odd">
2480 <td style="text-align: left;">locHasNullTerminator</td>
2481 <td style="text-align: left;">Location (URL) is a null-terminated string</td>
2482 </tr>
2483 </tbody>
2484 </table>
2485
2486
2487 <h2 id="unknown-box-section">Unknown box</h2>
2488
2489
2490 <p>An image may contain boxes that are not defined by ISO/IEC 15444-1. Although <em>jpylyzer</em> ignores such boxes, it will report some minimal info that will allow interested users to identify them to a limited extent.</p>
2491
2492
2493 <h3 id="element-name-17">Element name</h3>
2494
2495
2496 <p>unknownBox</p>
2497
2498
2499 <h3 id="reported-properties-17">Reported properties</h3>
2500
2501
2502 <table>
2503 <thead>
2504 <tr class="header">
2505 <th style="text-align: left;">Property</th>
2506 <th style="text-align: left;">Description</th>
2507 </tr>
2508 </thead>
2509 <tbody>
2510 <tr class="odd">
2511 <td style="text-align: left;">boxType</td>
2512 <td style="text-align: left;">Four-character text string that specifies the type of information that is found in this box (corresponds to <em>TBox</em> in section I.4 of ISO/IEC 15444-1).</td>
2513 </tr>
2514 </tbody>
2515 </table>
2516
2517
2518 <h2 id="top-level-tests-properties">Top-level tests and properties</h2>
2519
2520
2521 <p>This sub-section describes the tests and output for the top file level.</p>
2522
2523
2524 <h3 id="element-name-18">Element name</h3>
2525
2526
2527 <p>properties</p>
2528
2529
2530 <h3 id="reported-properties-18">Reported properties</h3>
2531
2532
2533 <p>The metrics that are listed here are not ‘properties’ in a strict sense; instead they are secondary or derived metrics that are calculated by combining information from different parts / boxes of the file.</p>
2534
2535
2536 <table>
2537 <thead>
2538 <tr class="header">
2539 <th style="text-align: left;">Property</th>
2540 <th style="text-align: left;">Description</th>
2541 </tr>
2542 </thead>
2543 <tbody>
2544 <tr class="odd">
2545 <td style="text-align: left;">compressionRatio</td>
2546 <td style="text-align: left;">Compression ratio</td>
2547 </tr>
2548 </tbody>
2549 </table>
2550
2551
2552 <p>The compression ratio is calculated as the ratio between the size of the uncompressed image data and the actual file size:</p>
2553
2554
2555 <p><math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>compressionRatio</mi> <mo>=</mo> <mfrac> <mrow> <mi>sizeUncompressed</mi> </mrow> <mrow> <mi>sizeCompressed</mi> </mrow> </mfrac> </mrow> </math></p>
2556
2557
2558 <p>Here, <em>sizeCompressed</em> is simply the file size (<em>fileSizeInBytes</em> in output file’s ‘fileInfo’ element). The uncompressed size (in bytes) can be calculated by multiplying the number of bytes per pixel by the total number of pixels:</p>
2559
2560
2561 <p><math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>sizeUncompressed</mi> <mo>=</mo> <mfrac> <mrow> <mn>1</mn> </mrow> <mrow> <mn>8</mn> </mrow> </mfrac> <munderover> <mo>∑</mo> <mrow> <mi>i</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>nC</mi> </munderover> <msub> <mi>bPCDepth</mi> <mi>i</mi> </msub> <mo>•</mo> <mi>height</mi> <mo>•</mo> <mi>width</mi> </mrow> </math></p>
2562
2563
2564 <p>With:</p>
2565
2566
2567 <dl>
2568 <dt>nC</dt>
2569 <dd>number of image components (from Image Header box)
2570 </dd>
2571 <dt>i</dt>
2572 <dd>component index
2573 </dd>
2574 <dt>bPCDepth<sub>i</sub></dt>
2575 <dd>bits per component for component <em>i</em> (from Image Header box or Bits Per Component box)
2576 </dd>
2577 <dt>height</dt>
2578 <dd>image height (from Image Header box)
2579 </dd>
2580 <dt>width</dt>
2581 <dd>image width (from Image Header box)
2582 </dd>
2583 </dl>
2584
2585
2586 <p>In addition, the root of the properties tree contains the elements for all top-level boxes:</p>
2587
2588
2589 <table>
2590 <thead>
2591 <tr class="header">
2592 <th style="text-align: left;">Child element</th>
2593 <th style="text-align: left;">Description</th>
2594 </tr>
2595 </thead>
2596 <tbody>
2597 <tr class="odd">
2598 <td style="text-align: left;"><a href="#jpeg2000-signature-box">signatureBox</a></td>
2599 <td style="text-align: left;">Properties from JPEG 2000 Signature box</td>
2600 </tr>
2601 <tr class="even">
2602 <td style="text-align: left;"><a href="#file-type-box">fileTypeBox</a></td>
2603 <td style="text-align: left;">Properties from File Type box</td>
2604 </tr>
2605 <tr class="odd">
2606 <td style="text-align: left;"><a href="#jp2-header-box">jp2HeaderBox</a></td>
2607 <td style="text-align: left;">Properties from JP2 Header box</td>
2608 </tr>
2609 <tr class="even">
2610 <td style="text-align: left;"><a href="#contiguous-codestream-box-chapter">contiguousCodestreamBox</a></td>
2611 <td style="text-align: left;">Properties from Contiguous Codestream box</td>
2612 </tr>
2613 <tr class="odd">
2614 <td style="text-align: left;"><a href="#intellectual-property-box">intellectualPropertyBox</a></td>
2615 <td style="text-align: left;">Properties from Intellectual Property box (optional)</td>
2616 </tr>
2617 <tr class="even">
2618 <td style="text-align: left;"><a href="#xml-box">xmlBox</a></td>
2619 <td style="text-align: left;">Properties from XML box (optional)</td>
2620 </tr>
2621 <tr class="odd">
2622 <td style="text-align: left;"><a href="#uuid-box">uuidBox</a></td>
2623 <td style="text-align: left;">Properties from UUID box (optional)</td>
2624 </tr>
2625 <tr class="even">
2626 <td style="text-align: left;"><a href="#uuid-info-box">uuidInfoBox</a></td>
2627 <td style="text-align: left;">Properties from UUID Info box (optional)</td>
2628 </tr>
2629 </tbody>
2630 </table>
2631
2632
2633 <h3 id="tests-17">Tests</h3>
2634
2635
2636 <p>The tests that <em>jpylyzer</em> performs at the root level fall in either of the following two categories:</p>
2637
2638
2639 <ol type="1">
2640 <li><p>Tests for the presence of required top-level boxes, the order in which they appear and restrictions on the number of instances for specific boxes</p></li>
2641 <li><p>Tests for consistency of information in different parts of the file. In particular, a lot of the information in the Image Header box is redundant with information in the codestream header, and <em>jpylyzer</em> performs a number of tests to verify the consistency between these two.</p></li>
2642 </ol>
2643
2644
2645 <table>
2646 <thead>
2647 <tr class="header">
2648 <th style="text-align: left;">Test name</th>
2649 <th style="text-align: left;">True if</th>
2650 </tr>
2651 </thead>
2652 <tbody>
2653 <tr class="odd">
2654 <td style="text-align: left;">containsSignatureBox</td>
2655 <td style="text-align: left;">File root contains a JPEG 2000 Signature box</td>
2656 </tr>
2657 <tr class="even">
2658 <td style="text-align: left;">containsFileTypeBox</td>
2659 <td style="text-align: left;">File root contains a File Type box</td>
2660 </tr>
2661 <tr class="odd">
2662 <td style="text-align: left;">containsJP2HeaderBox</td>
2663 <td style="text-align: left;">File root contains a JP2 Header box</td>
2664 </tr>
2665 <tr class="even">
2666 <td style="text-align: left;">containsContiguousCodestreamBox</td>
2667 <td style="text-align: left;">File root contains a Contiguous Codestream box</td>
2668 </tr>
2669 <tr class="odd">
2670 <td style="text-align: left;">containsIntellectualPropertyBox</td>
2671 <td style="text-align: left;">File root contains an Intellectual Property box, which is required if <em>iPR</em> field in Image Header Box equals 1 (test is skipped otherwise)</td>
2672 </tr>
2673 <tr class="even">
2674 <td style="text-align: left;">firstBoxIsSignatureBox</td>
2675 <td style="text-align: left;">First box is JPEG 2000 Signature box</td>
2676 </tr>
2677 <tr class="odd">
2678 <td style="text-align: left;">secondBoxIsFileTypeBox</td>
2679 <td style="text-align: left;">Second box is File Type box</td>
2680 </tr>
2681 <tr class="even">
2682 <td style="text-align: left;">locationJP2HeaderBoxIsValid</td>
2683 <td style="text-align: left;">JP2 Header box is located after File Type Box and before (first) Contiguous Codestream box</td>
2684 </tr>
2685 <tr class="odd">
2686 <td style="text-align: left;">noMoreThanOneSignatureBox</td>
2687 <td style="text-align: left;">File root contains no more than one JPEG 2000 Signature box</td>
2688 </tr>
2689 <tr class="even">
2690 <td style="text-align: left;">noMoreThanOneFileTypeBox</td>
2691 <td style="text-align: left;">File root contains no more than one File Type box</td>
2692 </tr>
2693 <tr class="odd">
2694 <td style="text-align: left;">noMoreThanOneJP2HeaderBox</td>
2695 <td style="text-align: left;">File root contains no more than one JP2 Header box</td>
2696 </tr>
2697 <tr class="even">
2698 <td style="text-align: left;">heightConsistentWithSIZ</td>
2699 <td style="text-align: left;">Value of <em>height</em> from Image Header Box equals <em>ysiz –yOsiz</em> from codestream SIZ header</td>
2700 </tr>
2701 <tr class="odd">
2702 <td style="text-align: left;">widthConsistentWithSIZ</td>
2703 <td style="text-align: left;">Value of <em>width</em> from Image Header Box equals <em>xsiz</em> –<em>xOsiz</em> from codestream SIZ header</td>
2704 </tr>
2705 <tr class="even">
2706 <td style="text-align: left;">nCConsistentWithSIZ</td>
2707 <td style="text-align: left;">Value of <em>nC</em> from Image Header Box equals <em>csiz</em> from codestream SIZ header</td>
2708 </tr>
2709 <tr class="odd">
2710 <td style="text-align: left;">bPCSignConsistentWithSIZ</td>
2711 <td style="text-align: left;">Values of <em>bPCSign</em> from Image Header box (or Bits Per Component box) are equal to corresponding <em>ssizSign</em> values from codestream SIZ header</td>
2712 </tr>
2713 <tr class="even">
2714 <td style="text-align: left;">bPCDepthConsistentWithSIZ</td>
2715 <td style="text-align: left;">Values of <em>bPCDepth</em> from Image Header box (or Bits Per Component box) are equal to corresponding <em>ssizDepth</em> values from codestream SIZ header</td>
2716 </tr>
2717 </tbody>
2718 </table>
2719
2720
2721 <h1 id="contiguous-codestream-box-chapter">Contiguous Codestream box</h1>
2722
2723
2724 <h2 id="codestream-structure">General codestream structure</h2>
2725
2726
2727 <p>The Contiguous Codestream box holds the JPEG 2000 codestream, which contains the actual image data in a JP2.</p>
2728
2729
2730 <h3 id="markers-and-marker-segments">Markers and marker segments</h3>
2731
2732
2733 <p>A codestream is made up of a number of functional entities which are called <em>markers</em> and <em>marker segments</em>. A <em>marker</em> is essentially a 2-byte delimiter that delineates the start or end position of a functional entity. A <em>marker segment</em> is the combination of a marker and a set of associated parameters (<em>segment parameters</em>). However, not every marker has any associated parameters.</p>
2734
2735
2736 <h3 id="general-structure-of-the-codestream">General structure of the codestream</h3>
2737
2738
2739 <p>The codestream is made up of a number of components. The Figure below gives an overview.</p>
2740
2741
2742 <figure>
2743 <img src="images/codestreamStructure.png" alt="General structure of a JPEG 2000 codestream."/><figcaption aria-hidden="true">General structure of a JPEG 2000 codestream.</figcaption>
2744 </figure>
2745
2746
2747 <p>From top to bottom, the Figure shows the following components:</p>
2748
2749
2750 <ol type="1">
2751 <li><p>A <em>start of codestream</em> (SOC) marker, which indicates the start of the codestream</p></li>
2752 <li><p>A main codestream header (which includes a number of header marker segments)</p></li>
2753 <li><p>A sequence of one or more <em>tile parts</em>. Each tile part consists of the following components:</p>
2754 <ol type="a">
2755 <li><p>A <em>start of tile-part</em> (SOT) marker segment, which indicates the start of a tile part, and which also contains index information of the tile part and its associated tile</p></li>
2756 <li><p>Optionally this may be followed by one or more additional tile-part header marker segments</p></li>
2757 <li><p>A <em>start of data</em> (SOD) marker that indicates the start of the bitstream for the current tile part</p></li>
2758 <li><p>The bitstream</p></li>
2759 </ol></li>
2760 <li><p>An ‘end of codestream’ (EOC) marker that indicates the end of the codestream.</p></li>
2761 </ol>
2762
2763
2764 <h2 id="limitations-codestream-validation">Limitations of codestream validation</h2>
2765
2766
2767 <p>It is important to stress here that <em>jpylyzer</em> currently doesn’t support the full set of marker segments that can occur in a codestream. As a result, the validation of codestreams is somewhat limited. These limitations are discussed in this sub-section.</p>
2768
2769
2770 <h3 id="main-codestream-header">Main codestream header</h3>
2771
2772
2773 <p>Annex A of ISO/IEC 15444-1 lists a total of 13 marker segments that can occur in the main codestream header. Most of these are optional. The current version of <em>jpylyzer</em> only offers full support (i.e. reads and validates) for the following main header marker segments (which includes all the required ones):</p>
2774
2775
2776 <ul>
2777 <li><p>Start of codestream (SOC) marker segment (required)</p></li>
2778 <li><p>Image and tile size (SIZ) marker segment (required)</p></li>
2779 <li><p>Coding style default (COD) marker segment (required)</p></li>
2780 <li><p>Coding style component (COC) marker segment (optional)</p></li>
2781 <li><p>Region-of-interest (RGN) marker segment (optional)</p></li>
2782 <li><p>Quantization default (QCD) marker segment (required)</p></li>
2783 <li><p>Quantization component (QCC) marker segment (optional)</p></li>
2784 <li><p>Progression order change (POC) marker segment (optional)</p></li>
2785 <li><p>Component registration (CRG) marker segment (optional)</p></li>
2786 <li><p>Comment (COM) marker segment (optional)</p></li>
2787 </ul>
2788
2789
2790 <p>In addition the codestream header may also contain any of the following marker segments, which are all optional:</p>
2791
2792
2793 <ul>
2794 <li><p>Packet length, main header (PLM) marker segment (optional) <sup>*</sup></p></li>
2795 <li><p>Packed packet headers, main header (PPM) marker segment (optional) <sup>*</sup></p></li>
2796 <li><p>Tile-part lengths (TLM) marker segment (optional) <sup>*</sup></p></li>
2797 </ul>
2798
2799
2800 <p>The optional markers that are marked with an asterisk above are only minimally supported at this stage.</p>
2801
2802
2803 <h3 id="tile-parts">Tile parts</h3>
2804
2805
2806 <p>The tile part validation has similar limitations. The standard lists 11 marker segments that can occur in the tile part header. Currently, <em>jpylyzer</em> only fully supports the following ones:</p>
2807
2808
2809 <ul>
2810 <li><p>Start of tile part (SOT) marker segment (required)</p></li>
2811 <li><p>Coding style default (COD) marker segment (optional)</p></li>
2812 <li><p>Coding style component (COC) marker segment (optional)</p></li>
2813 <li><p>Region-of-interest (RGN) marker segment (optional)</p></li>
2814 <li><p>Quantization default (QCD) marker segment (optional)</p></li>
2815 <li><p>Quantization component (QCC) marker segment (optional)</p></li>
2816 <li><p>Progression order change (POC) marker segment (optional)</p></li>
2817 <li><p>Comment (COM) marker segment (optional)</p></li>
2818 <li><p>Start of data (SOD) marker segment (required)</p></li>
2819 </ul>
2820
2821
2822 <p>In addition the following optional marker segments may also occur:</p>
2823
2824
2825 <ul>
2826 <li><p>Packet length, tile-part header (PLT) marker segment (optional) <sup>*</sup></p></li>
2827 <li><p>Packed packet headers, tile-part header (PPT) marker segment (optional) <sup>*</sup></p></li>
2828 </ul>
2829
2830
2831 <p>The optional markers that are marked with an asterisk above are only minimally supported at this stage: if <em>jpylyzer</em> encounters them, it will include the corresponding element in the <em>properties</em> element of the output. However, <em>jpylyzer</em> does not analyse the contents of these marker segments, which means that the respective elements in the output will be empty.</p>
2832
2833
2834 <h3 id="bit-streams">Bit streams</h3>
2835
2836
2837 <p>In addition to the above limitations, <em>jpylyzer</em> can <em>not</em> be used to establish whether the data in the bitstream are correct (this would require decoding the compressed image data, which is completely out of <em>jpylyzer</em>’s scope)<a href="#fn15" class="footnote-ref" id="fnref15" role="doc-noteref"><sup>15</sup></a>. As a result, if <em>jpylyzer</em> is used as part of a quality assurance workflow, it is recommended to also include an additional check on the image contents<a href="#fn16" class="footnote-ref" id="fnref16" role="doc-noteref"><sup>16</sup></a>. Also, <em>jpylyzer</em> does not perform any checks on marker segments within the bit-stream: start-of packet (SOP) and end-of-packet (EPH) markers.</p>
2838
2839
2840 <h3 id="detection-of-incomplete-or-truncated-codestreams">Detection of incomplete or truncated codestreams</h3>
2841
2842
2843 <p>A JP2’s tile part header contains information that makes it possible to detect incomplete and truncated codestreams in most cases. Depending on the encoder software used, this method may fail for images that only contain one single tile part (i.e. images that do not contain tiling).</p>
2844
2845
2846 <h3 id="current-limitations-of-comment-extraction">Current limitations of comment extraction</h3>
2847
2848
2849 <p>Both the codestream header and the tile part header can contain comment marker segments, which are used for embedding arbitrary binary data or text. <em>Jpylyzer</em> will extract the contents of any comments that are text.</p>
2850
2851
2852 <h2 id="structure-reported-output">Structure of reported output</h2>
2853
2854
2855 <p>The Figure below illustrates the structure of <em>jpylyzer</em>’s codestream-level output.</p>
2856
2857
2858 <figure>
2859 <img src="images/codestreamOutput.png" alt="Structure of codestream-level XML output."/><figcaption aria-hidden="true">Structure of codestream-level XML output.</figcaption>
2860 </figure>
2861
2862
2863 <p>At the top level, the SIZ, COD, QCD and COM marker segments are each represented as individual sub elements. The tile part properties are nested in a <em>tileParts</em> element, where each individual tile part is represented as a separate <em>tilePart</em> sub element.</p>
2864
2865
2866 <h2 id="contiguous-codestream-box">Contiguous Codestream box</h2>
2867
2868
2869 <h3 id="element-name-19">Element name</h3>
2870
2871
2872 <p>contiguousCodestreamBox</p>
2873
2874
2875 <h3 id="reported-properties-19">Reported properties</h3>
2876
2877
2878 <p>The reported properties for this box are organised into a number groups, which are represented as child elements in the properties tree:</p>
2879
2880
2881 <table>
2882 <thead>
2883 <tr class="header">
2884 <th style="text-align: left;">Child element</th>
2885 <th style="text-align: left;">Description</th>
2886 </tr>
2887 </thead>
2888 <tbody>
2889 <tr class="odd">
2890 <td style="text-align: left;"><a href="#siz-marker">siz</a></td>
2891 <td style="text-align: left;">Properties from the image and tile size (SIZ) marker segment (codestream main header)</td>
2892 </tr>
2893 <tr class="even">
2894 <td style="text-align: left;"><a href="#cod-marker">cod</a></td>
2895 <td style="text-align: left;">Properties from the coding style default (COD) marker segment (codestream main header)</td>
2896 </tr>
2897 <tr class="odd">
2898 <td style="text-align: left;"><a href="#coc-marker">coc</a></td>
2899 <td style="text-align: left;">Properties from the (optional) coding style component (COC) marker segment (codestream main header)</td>
2900 </tr>
2901 <tr class="even">
2902 <td style="text-align: left;"><a href="#rgn-marker">rgn</a></td>
2903 <td style="text-align: left;">Properties from the (optional) region of interest (RGN) marker segment (codestream main header)</td>
2904 </tr>
2905 <tr class="odd">
2906 <td style="text-align: left;"><a href="#qcd-marker">qcd</a></td>
2907 <td style="text-align: left;">Properties from the quantization default (QCD) marker segment (codestream main header)</td>
2908 </tr>
2909 <tr class="even">
2910 <td style="text-align: left;"><a href="#qcc-marker">qcc</a></td>
2911 <td style="text-align: left;">Properties from the (optional) quantization component (QCC) marker segment (codestream main header)</td>
2912 </tr>
2913 <tr class="odd">
2914 <td style="text-align: left;"><a href="#poc-marker">poc</a></td>
2915 <td style="text-align: left;">Properties from the (optional) progression order change (POC) marker segment (codestream main header)</td>
2916 </tr>
2917 <tr class="even">
2918 <td style="text-align: left;"><a href="#crg-marker">crg</a></td>
2919 <td style="text-align: left;">Properties from the (optional) component registration (CRG) marker segment (codestream main header)</td>
2920 </tr>
2921 <tr class="odd">
2922 <td style="text-align: left;"><a href="#com-marker">com</a></td>
2923 <td style="text-align: left;">Properties from the (optional) comment (COM) marker segment (codestream main header)</td>
2924 </tr>
2925 <tr class="even">
2926 <td style="text-align: left;"><a href="#plm-marker">plm</a></td>
2927 <td style="text-align: left;">Properties from the (optional) packet length (PLM) marker (codestream main header)</td>
2928 </tr>
2929 <tr class="odd">
2930 <td style="text-align: left;"><a href="#ppm-marker">ppm</a></td>
2931 <td style="text-align: left;">Properties from the (optional) packed packet headers(PPM) marker segment (codestream main header)</td>
2932 </tr>
2933 <tr class="even">
2934 <td style="text-align: left;"><a href="#tile-part">tileParts</a></td>
2935 <td style="text-align: left;">Properties from individual tile parts</td>
2936 </tr>
2937 </tbody>
2938 </table>
2939
2940
2941 <p>Note that the <em>plm</em> and <em>ppm</em> elements are only written if the <code>--packetmarkers</code> option is used. The number of PLM and PPM markers is given by the following 2 derived properties (these are always reported, irrespective of <code>--packetmarkers</code>):</p>
2942
2943
2944 <table>
2945 <thead>
2946 <tr class="header">
2947 <th style="text-align: left;">Property</th>
2948 <th style="text-align: left;">Description</th>
2949 </tr>
2950 </thead>
2951 <tbody>
2952 <tr class="odd">
2953 <td style="text-align: left;">plmCount</td>
2954 <td style="text-align: left;">Number of PLM markers in main header</td>
2955 </tr>
2956 <tr class="even">
2957 <td style="text-align: left;">ppmCount</td>
2958 <td style="text-align: left;">Number of PPM markers in main header</td>
2959 </tr>
2960 </tbody>
2961 </table>
2962
2963
2964 <h3 id="tests-18">Tests</h3>
2965
2966
2967 <table>
2968 <thead>
2969 <tr class="header">
2970 <th style="text-align: left;">Test name</th>
2971 <th style="text-align: left;">True if</th>
2972 </tr>
2973 </thead>
2974 <tbody>
2975 <tr class="odd">
2976 <td style="text-align: left;">codestreamStartsWithSOCMarker</td>
2977 <td style="text-align: left;">First 2 bytes in codestream constitute a start of codestream (SOC) marker segment</td>
2978 </tr>
2979 <tr class="even">
2980 <td style="text-align: left;">foundSIZMarker</td>
2981 <td style="text-align: left;">Second marker segment in codestream is image and tile size (SIZ) marker segment</td>
2982 </tr>
2983 <tr class="odd">
2984 <td style="text-align: left;">foundCODMarker</td>
2985 <td style="text-align: left;">Codestream main header contains coding style default (COD) marker segment</td>
2986 </tr>
2987 <tr class="even">
2988 <td style="text-align: left;">foundQCDMarker</td>
2989 <td style="text-align: left;">Codestream main header contains quantization default (QCD) marker segment</td>
2990 </tr>
2991 <tr class="odd">
2992 <td style="text-align: left;">foundExpectedNumberOfTiles</td>
2993 <td style="text-align: left;">Number of encountered tiles is consistent with expected number of tiles (as calculated from <a href="#siz-marker">SIZ marker</a>)</td>
2994 </tr>
2995 <tr class="even">
2996 <td style="text-align: left;">foundExpectedNumberOfTileParts</td>
2997 <td style="text-align: left;">For all tiles, number of encountered tile parts is consistent with expected number of tile parts (values of <em>tnsot</em> from <a href="#sot-marker">SOT marker</a>)</td>
2998 </tr>
2999 <tr class="odd">
3000 <td style="text-align: left;">maxOneCcocPerComponent</td>
3001 <td style="text-align: left;">No more than one <em>ccoc</em> value for each component (only reported if codestream contains any COC marker segments)</td>
3002 </tr>
3003 <tr class="even">
3004 <td style="text-align: left;">maxOneCqccPerComponent</td>
3005 <td style="text-align: left;">No more than one <em>cqcc</em> value for each component (only reported if codestream contains any QCC marker segments)</td>
3006 </tr>
3007 <tr class="odd">
3008 <td style="text-align: left;">foundEOCMarker</td>
3009 <td style="text-align: left;">Last 2 bytes in codestream constitute an end of codestream (EOC) marker segment</td>
3010 </tr>
3011 </tbody>
3012 </table>
3013
3014
3015 <h2 id="siz-marker">Image and tile size (SIZ) marker segment (child of Contiguous Codestream box)</h2>
3016
3017
3018 <h3 id="element-name-20">Element name</h3>
3019
3020
3021 <p>siz</p>
3022
3023
3024 <h3 id="reported-properties-20">Reported properties</h3>
3025
3026
3027 <table>
3028 <thead>
3029 <tr class="header">
3030 <th style="text-align: left;">Property</th>
3031 <th style="text-align: left;">Description</th>
3032 </tr>
3033 </thead>
3034 <tbody>
3035 <tr class="odd">
3036 <td style="text-align: left;">lsiz</td>
3037 <td style="text-align: left;">Length of SIZ marker segment in bytes</td>
3038 </tr>
3039 <tr class="even">
3040 <td style="text-align: left;">rsiz</td>
3041 <td style="text-align: left;">Decoder capabilities</td>
3042 </tr>
3043 <tr class="odd">
3044 <td style="text-align: left;">xsiz</td>
3045 <td style="text-align: left;">Width of reference grid</td>
3046 </tr>
3047 <tr class="even">
3048 <td style="text-align: left;">ysiz</td>
3049 <td style="text-align: left;">Height of reference grid</td>
3050 </tr>
3051 <tr class="odd">
3052 <td style="text-align: left;">xOsiz</td>
3053 <td style="text-align: left;">Horizontal offset from origin of reference grid to left of image area</td>
3054 </tr>
3055 <tr class="even">
3056 <td style="text-align: left;">yOsiz</td>
3057 <td style="text-align: left;">Vertical offset from origin of reference grid to top of image area</td>
3058 </tr>
3059 <tr class="odd">
3060 <td style="text-align: left;">xTsiz</td>
3061 <td style="text-align: left;">Width of one reference tile with respect to the reference grid</td>
3062 </tr>
3063 <tr class="even">
3064 <td style="text-align: left;">yTsiz</td>
3065 <td style="text-align: left;">Height of one reference tile with respect to the reference grid</td>
3066 </tr>
3067 <tr class="odd">
3068 <td style="text-align: left;">xTOsiz</td>
3069 <td style="text-align: left;">Horizontal offset from origin of reference grid to left side of first tile</td>
3070 </tr>
3071 <tr class="even">
3072 <td style="text-align: left;">yTOsiz</td>
3073 <td style="text-align: left;">Vertical offset from origin of reference grid to top side of first tile</td>
3074 </tr>
3075 <tr class="odd">
3076 <td style="text-align: left;">numberOfTiles</td>
3077 <td style="text-align: left;">Number of tiles<a href="#fn17" class="footnote-ref" id="fnref17" role="doc-noteref"><sup>17</sup></a></td>
3078 </tr>
3079 <tr class="even">
3080 <td style="text-align: left;">csiz</td>
3081 <td style="text-align: left;">Number of components</td>
3082 </tr>
3083 <tr class="odd">
3084 <td style="text-align: left;">ssizSign<sup>*</sup></td>
3085 <td style="text-align: left;">Indicates whether image component is signed or unsigned (repeated for all components)</td>
3086 </tr>
3087 <tr class="even">
3088 <td style="text-align: left;">ssizDepth<sup>*</sup></td>
3089 <td style="text-align: left;">Number of bits for this component (repeated for all components)</td>
3090 </tr>
3091 <tr class="odd">
3092 <td style="text-align: left;">xRsiz<sup>*</sup></td>
3093 <td style="text-align: left;">Horizontal separation of sample of this component with respect to reference grid (repeated for all components)</td>
3094 </tr>
3095 <tr class="even">
3096 <td style="text-align: left;">yRsiz<sup>*</sup></td>
3097 <td style="text-align: left;">Vertical separation of sample of this component with respect to reference grid (repeated for all components)</td>
3098 </tr>
3099 </tbody>
3100 </table>
3101
3102
3103 <h3 id="tests-19">Tests</h3>
3104
3105
3106 <table>
3107 <thead>
3108 <tr class="header">
3109 <th style="text-align: left;">Test name</th>
3110 <th style="text-align: left;">True if</th>
3111 </tr>
3112 </thead>
3113 <tbody>
3114 <tr class="odd">
3115 <td style="text-align: left;">lsizIsValid</td>
3116 <td style="text-align: left;"><em>lsiz</em> is within range [41,49190]</td>
3117 </tr>
3118 <tr class="even">
3119 <td style="text-align: left;">rsizIsValid</td>
3120 <td style="text-align: left;"><em>rsiz</em> equals 0 (“ISO/IEC 15444-1”), 1 (“Profile 0”) or 2 (“Profile 1”)</td>
3121 </tr>
3122 <tr class="odd">
3123 <td style="text-align: left;">xsizIsValid</td>
3124 <td style="text-align: left;"><em>xsiz</em> is within range [1,2<sup>32</sup> - 1]</td>
3125 </tr>
3126 <tr class="even">
3127 <td style="text-align: left;">ysizIsValid</td>
3128 <td style="text-align: left;"><em>ysiz</em> is within range [1,2<sup>32</sup> - 1]</td>
3129 </tr>
3130 <tr class="odd">
3131 <td style="text-align: left;">xOsizIsValid</td>
3132 <td style="text-align: left;"><em>xOsiz</em> is within range [0,2<sup>32</sup> - 2]</td>
3133 </tr>
3134 <tr class="even">
3135 <td style="text-align: left;">yOsizIsValid</td>
3136 <td style="text-align: left;"><em>yOsiz</em> is within range [0,2<sup>32</sup> - 2]</td>
3137 </tr>
3138 <tr class="odd">
3139 <td style="text-align: left;">xTsizIsValid</td>
3140 <td style="text-align: left;"><em>xTsiz</em> is within range [1,2<sup>32</sup> - 1]</td>
3141 </tr>
3142 <tr class="even">
3143 <td style="text-align: left;">yTsizIsValid</td>
3144 <td style="text-align: left;"><em>yTsiz</em> is within range [1,2<sup>32</sup> - 1]</td>
3145 </tr>
3146 <tr class="odd">
3147 <td style="text-align: left;">xTOsizIsValid</td>
3148 <td style="text-align: left;"><em>xTOsiz</em> is within range [0,2<sup>32</sup> - 2]</td>
3149 </tr>
3150 <tr class="even">
3151 <td style="text-align: left;">yTOsizIsValid</td>
3152 <td style="text-align: left;"><em>yTOsiz</em> is within range [0,2<sup>32</sup> - 2]</td>
3153 </tr>
3154 <tr class="odd">
3155 <td style="text-align: left;">csizIsValid</td>
3156 <td style="text-align: left;"><em>csiz</em> is within range [1,16384]</td>
3157 </tr>
3158 <tr class="even">
3159 <td style="text-align: left;">lsizConsistentWithCsiz</td>
3160 <td style="text-align: left;"><em>lsiz</em> equals 38 + 3*<em>csiz</em></td>
3161 </tr>
3162 <tr class="odd">
3163 <td style="text-align: left;">ssizIsValid<sup>*</sup></td>
3164 <td style="text-align: left;"><em>ssizDepth</em> is within range [1,38] (repeated for all components)</td>
3165 </tr>
3166 <tr class="even">
3167 <td style="text-align: left;">xRsizIsValid<sup>*</sup></td>
3168 <td style="text-align: left;"><em>xRsiz</em> is within range [1,255] (repeated for all components)</td>
3169 </tr>
3170 <tr class="odd">
3171 <td style="text-align: left;">yRsizIsValid<sup>*</sup></td>
3172 <td style="text-align: left;"><em>yRsiz</em> is within range [1,255] (repeated for all components)</td>
3173 </tr>
3174 </tbody>
3175 </table>
3176
3177
3178 <h2 id="cod-marker">Coding style default (COD) marker segment</h2>
3179
3180
3181 <h3 id="element-name-21">Element name</h3>
3182
3183
3184 <p>cod</p>
3185
3186
3187 <h3 id="reported-properties-21">Reported properties</h3>
3188
3189
3190 <table>
3191 <thead>
3192 <tr class="header">
3193 <th style="text-align: left;">Property</th>
3194 <th style="text-align: left;">Description</th>
3195 </tr>
3196 </thead>
3197 <tbody>
3198 <tr class="odd">
3199 <td style="text-align: left;">lcod</td>
3200 <td style="text-align: left;">Length of COD marker segment in bytes</td>
3201 </tr>
3202 <tr class="even">
3203 <td style="text-align: left;">precincts</td>
3204 <td style="text-align: left;">Indicates default or user-defined precinct size (“default”/“user defined”)</td>
3205 </tr>
3206 <tr class="odd">
3207 <td style="text-align: left;">sop</td>
3208 <td style="text-align: left;">Indicates use of start of packet marker segments (“yes”/“no”)</td>
3209 </tr>
3210 <tr class="even">
3211 <td style="text-align: left;">eph</td>
3212 <td style="text-align: left;">Indicates use of end of packet marker segments (“yes”/“no”)</td>
3213 </tr>
3214 <tr class="odd">
3215 <td style="text-align: left;">order</td>
3216 <td style="text-align: left;">Progression order</td>
3217 </tr>
3218 <tr class="even">
3219 <td style="text-align: left;">layers</td>
3220 <td style="text-align: left;">Number of layers</td>
3221 </tr>
3222 <tr class="odd">
3223 <td style="text-align: left;">multipleComponentTransformation</td>
3224 <td style="text-align: left;">Indicates use of multiple component transformation (“yes”/“no”)</td>
3225 </tr>
3226 <tr class="even">
3227 <td style="text-align: left;">levels</td>
3228 <td style="text-align: left;">Number of decomposition levels</td>
3229 </tr>
3230 <tr class="odd">
3231 <td style="text-align: left;">codeBlockWidth</td>
3232 <td style="text-align: left;">Code block width</td>
3233 </tr>
3234 <tr class="even">
3235 <td style="text-align: left;">codeBlockHeight</td>
3236 <td style="text-align: left;">Code block height</td>
3237 </tr>
3238 <tr class="odd">
3239 <td style="text-align: left;">codingBypass</td>
3240 <td style="text-align: left;">Indicates use of coding bypass (“yes”/“no”)</td>
3241 </tr>
3242 <tr class="even">
3243 <td style="text-align: left;">resetOnBoundaries</td>
3244 <td style="text-align: left;">Indicates reset of context probabilities on coding pass boundaries (“yes”/“no”)</td>
3245 </tr>
3246 <tr class="odd">
3247 <td style="text-align: left;">termOnEachPass</td>
3248 <td style="text-align: left;">Indicates termination on each coding pass (“yes”/“no”)</td>
3249 </tr>
3250 <tr class="even">
3251 <td style="text-align: left;">vertCausalContext</td>
3252 <td style="text-align: left;">Indicates vertically causal context (“yes”/“no”)</td>
3253 </tr>
3254 <tr class="odd">
3255 <td style="text-align: left;">predTermination</td>
3256 <td style="text-align: left;">Indicates predictable termination (“yes”/“no”)</td>
3257 </tr>
3258 <tr class="even">
3259 <td style="text-align: left;">segmentationSymbols</td>
3260 <td style="text-align: left;">Indicates use of segmentation symbols (“yes”/“no”)</td>
3261 </tr>
3262 <tr class="odd">
3263 <td style="text-align: left;">transformation</td>
3264 <td style="text-align: left;">Wavelet transformation: “9-7 irreversible” or “5-3 reversible”</td>
3265 </tr>
3266 <tr class="even">
3267 <td style="text-align: left;">precinctSizeX<sup>*</sup></td>
3268 <td style="text-align: left;">Precinct width (repeated for all resolution levels; order: low to high). Equals 32768 if <em>precincts</em> is “default”</td>
3269 </tr>
3270 <tr class="odd">
3271 <td style="text-align: left;">precinctSizeY<sup>*</sup></td>
3272 <td style="text-align: left;">Precinct height (repeated for all resolution levels; order: low to high). Equals 32768 if <em>precincts</em> is “default”</td>
3273 </tr>
3274 </tbody>
3275 </table>
3276
3277
3278 <h3 id="tests-20">Tests</h3>
3279
3280
3281 <table>
3282 <thead>
3283 <tr class="header">
3284 <th style="text-align: left;">Test name</th>
3285 <th style="text-align: left;">True if</th>
3286 </tr>
3287 </thead>
3288 <tbody>
3289 <tr class="odd">
3290 <td style="text-align: left;">lcodIsValid</td>
3291 <td style="text-align: left;"><em>lcod</em> is within range [12,45]</td>
3292 </tr>
3293 <tr class="even">
3294 <td style="text-align: left;">orderIsValid</td>
3295 <td style="text-align: left;"><em>order</em> equals 0 (“LRCP”), 1 (“RLCP”), 2 (“RPCL”), 3 (“PCRL”) or 4 (“CPRL”)</td>
3296 </tr>
3297 <tr class="odd">
3298 <td style="text-align: left;">layersIsValid</td>
3299 <td style="text-align: left;"><em>layers</em> is within range [1,65535]</td>
3300 </tr>
3301 <tr class="even">
3302 <td style="text-align: left;">multipleComponentTransformation</td>
3303 <td style="text-align: left;">IsValid</td>
3304 </tr>
3305 <tr class="odd">
3306 <td style="text-align: left;">levelsIsValid</td>
3307 <td style="text-align: left;"><em>levels</em> is within range [0,32]</td>
3308 </tr>
3309 <tr class="even">
3310 <td style="text-align: left;">lcodConsistencyCheck</td>
3311 <td style="text-align: left;"><em>lcod</em> value is consistent with <em>precincts</em> and <em>levels</em> (Eq A-2 in ISO/IEC 15444-1)</td>
3312 </tr>
3313 <tr class="odd">
3314 <td style="text-align: left;">codeBlockWidthExponentIsValid</td>
3315 <td style="text-align: left;"><em>codeBlockWidthExponent</em> is within range [2,10]</td>
3316 </tr>
3317 <tr class="even">
3318 <td style="text-align: left;">codeBlockHeightExponentIsValid</td>
3319 <td style="text-align: left;"><em>codeBlockHeightExponent</em> is within range [2,10]</td>
3320 </tr>
3321 <tr class="odd">
3322 <td style="text-align: left;">sumHeightWidthExponentIsValid</td>
3323 <td style="text-align: left;"><em>codeBlockWidthExponent</em> + <em>codeBlockHeightExponent</em> ≤ 12</td>
3324 </tr>
3325 <tr class="even">
3326 <td style="text-align: left;">precinctSizeXIsValid<sup>*</sup></td>
3327 <td style="text-align: left;"><em>precinctSizeX</em> ≥ 2 (except lowest resolution level) (repeated for all resolution levels; order: low to high) (only if <em>precincts</em> is “user defined”)</td>
3328 </tr>
3329 <tr class="odd">
3330 <td style="text-align: left;">precinctSizeYIsValid<sup>*</sup></td>
3331 <td style="text-align: left;"><em>precinctSizeY</em> ≥ 2 (except lowest resolution level) (repeated for all resolution levels; order: low to high) (only if <em>precincts</em> is “user defined”)</td>
3332 </tr>
3333 </tbody>
3334 </table>
3335
3336
3337 <h2 id="coc-marker">Coding style component (COC) marker segment</h2>
3338
3339
3340 <h3 id="element-name-22">Element name</h3>
3341
3342
3343 <p>coc</p>
3344
3345
3346 <h3 id="reported-properties-22">Reported properties</h3>
3347
3348
3349 <table>
3350 <thead>
3351 <tr class="header">
3352 <th style="text-align: left;">Property</th>
3353 <th style="text-align: left;">Description</th>
3354 </tr>
3355 </thead>
3356 <tbody>
3357 <tr class="odd">
3358 <td style="text-align: left;">lcoc</td>
3359 <td style="text-align: left;">Length of COC marker segment in bytes</td>
3360 </tr>
3361 <tr class="even">
3362 <td style="text-align: left;">ccoc</td>
3363 <td style="text-align: left;">Index of the component to which this marker segment relates</td>
3364 </tr>
3365 <tr class="odd">
3366 <td style="text-align: left;">precincts</td>
3367 <td style="text-align: left;">Indicates default or user-defined precinct size (“default”/“user defined”)</td>
3368 </tr>
3369 <tr class="even">
3370 <td style="text-align: left;">levels</td>
3371 <td style="text-align: left;">Number of decomposition levels</td>
3372 </tr>
3373 <tr class="odd">
3374 <td style="text-align: left;">codeBlockWidth</td>
3375 <td style="text-align: left;">Code block width</td>
3376 </tr>
3377 <tr class="even">
3378 <td style="text-align: left;">codeBlockHeight</td>
3379 <td style="text-align: left;">Code block height</td>
3380 </tr>
3381 <tr class="odd">
3382 <td style="text-align: left;">codingBypass</td>
3383 <td style="text-align: left;">Indicates use of coding bypass (“yes”/“no”)</td>
3384 </tr>
3385 <tr class="even">
3386 <td style="text-align: left;">resetOnBoundaries</td>
3387 <td style="text-align: left;">Indicates reset of context probabilities on coding pass boundaries (“yes”/“no”)</td>
3388 </tr>
3389 <tr class="odd">
3390 <td style="text-align: left;">termOnEachPass</td>
3391 <td style="text-align: left;">Indicates termination on each coding pass (“yes”/“no”)</td>
3392 </tr>
3393 <tr class="even">
3394 <td style="text-align: left;">vertCausalContext</td>
3395 <td style="text-align: left;">Indicates vertically causal context (“yes”/“no”)</td>
3396 </tr>
3397 <tr class="odd">
3398 <td style="text-align: left;">predTermination</td>
3399 <td style="text-align: left;">Indicates predictable termination (“yes”/“no”)</td>
3400 </tr>
3401 <tr class="even">
3402 <td style="text-align: left;">segmentationSymbols</td>
3403 <td style="text-align: left;">Indicates use of segmentation symbols (“yes”/“no”)</td>
3404 </tr>
3405 <tr class="odd">
3406 <td style="text-align: left;">transformation</td>
3407 <td style="text-align: left;">Wavelet transformation: “9-7 irreversible” or “5-3 reversible”</td>
3408 </tr>
3409 <tr class="even">
3410 <td style="text-align: left;">precinctSizeX<sup>*</sup></td>
3411 <td style="text-align: left;">Precinct width (repeated for all resolution levels; order: low to high). Equals 32768 if <em>precincts</em> is “default”</td>
3412 </tr>
3413 <tr class="odd">
3414 <td style="text-align: left;">precinctSizeY<sup>*</sup></td>
3415 <td style="text-align: left;">Precinct height (repeated for all resolution levels; order: low to high). Equals 32768 if <em>precincts</em> is “default”</td>
3416 </tr>
3417 </tbody>
3418 </table>
3419
3420
3421 <h3 id="tests-21">Tests</h3>
3422
3423
3424 <table>
3425 <thead>
3426 <tr class="header">
3427 <th style="text-align: left;">Test name</th>
3428 <th style="text-align: left;">True if</th>
3429 </tr>
3430 </thead>
3431 <tbody>
3432 <tr class="odd">
3433 <td style="text-align: left;">lcocIsValid</td>
3434 <td style="text-align: left;"><em>lcoc</em> is within range [9,43]</td>
3435 </tr>
3436 <tr class="even">
3437 <td style="text-align: left;">ccocIsValid</td>
3438 <td style="text-align: left;"><em>ccoc</em> is within range [0,255] (<em>csiz</em> &lt; 257) or [0,16383] (<em>csiz</em> &gt;= 257)</td>
3439 </tr>
3440 <tr class="odd">
3441 <td style="text-align: left;">levelsIsValid</td>
3442 <td style="text-align: left;"><em>levels</em> is within range [0,32]</td>
3443 </tr>
3444 <tr class="even">
3445 <td style="text-align: left;">lcocConsistencyCheck</td>
3446 <td style="text-align: left;"><em>lcoc</em> value is consistent with <em>levels</em>, <em>csiz</em> and <em>precincts</em> (Eq A-3 in ISO/IEC 15444-1)</td>
3447 </tr>
3448 <tr class="odd">
3449 <td style="text-align: left;">codeBlockWidthExponentIsValid</td>
3450 <td style="text-align: left;"><em>codeBlockWidthExponent</em> is within range [2,10]</td>
3451 </tr>
3452 <tr class="even">
3453 <td style="text-align: left;">codeBlockHeightExponentIsValid</td>
3454 <td style="text-align: left;"><em>codeBlockHeightExponent</em> is within range [2,10]</td>
3455 </tr>
3456 <tr class="odd">
3457 <td style="text-align: left;">sumHeightWidthExponentIsValid</td>
3458 <td style="text-align: left;"><em>codeBlockWidthExponent</em> + <em>codeBlockHeightExponent</em> ≤ 12</td>
3459 </tr>
3460 <tr class="even">
3461 <td style="text-align: left;">precinctSizeXIsValid<sup>*</sup></td>
3462 <td style="text-align: left;"><em>precinctSizeX</em> ≥ 2 (except lowest resolution level) (repeated for all resolution levels; order: low to high) (only if <em>precincts</em> is “user defined”)</td>
3463 </tr>
3464 <tr class="odd">
3465 <td style="text-align: left;">precinctSizeYIsValid<sup>*</sup></td>
3466 <td style="text-align: left;"><em>precinctSizeY</em> ≥ 2 (except lowest resolution level) (repeated for all resolution levels; order: low to high) (only if <em>precincts</em> is “user defined”)</td>
3467 </tr>
3468 </tbody>
3469 </table>
3470
3471
3472 <h2 id="rgn-marker">Region-of-interest (RGN) marker segment</h2>
3473
3474
3475 <h3 id="element-name-23">Element name</h3>
3476
3477
3478 <p>rgn</p>
3479
3480
3481 <h3 id="reported-properties-23">Reported properties</h3>
3482
3483
3484 <table>
3485 <thead>
3486 <tr class="header">
3487 <th style="text-align: left;">Property</th>
3488 <th style="text-align: left;">Description</th>
3489 </tr>
3490 </thead>
3491 <tbody>
3492 <tr class="odd">
3493 <td style="text-align: left;">lrgn</td>
3494 <td style="text-align: left;">Length of RGN marker segment in bytes</td>
3495 </tr>
3496 <tr class="even">
3497 <td style="text-align: left;">crgn</td>
3498 <td style="text-align: left;">Index of the component to which this marker segment relates</td>
3499 </tr>
3500 <tr class="odd">
3501 <td style="text-align: left;">roiStyle</td>
3502 <td style="text-align: left;">ROI style for the current ROI</td>
3503 </tr>
3504 <tr class="even">
3505 <td style="text-align: left;">roiShift</td>
3506 <td style="text-align: left;">Implicit ROI shift</td>
3507 </tr>
3508 </tbody>
3509 </table>
3510
3511
3512 <h3 id="tests-22">Tests</h3>
3513
3514
3515 <table>
3516 <thead>
3517 <tr class="header">
3518 <th style="text-align: left;">Test name</th>
3519 <th style="text-align: left;">True if</th>
3520 </tr>
3521 </thead>
3522 <tbody>
3523 <tr class="odd">
3524 <td style="text-align: left;">lrgnIsValid</td>
3525 <td style="text-align: left;"><em>lrgn</em> is within range [5,6]</td>
3526 </tr>
3527 <tr class="even">
3528 <td style="text-align: left;">crgnIsValid</td>
3529 <td style="text-align: left;"><em>crgn</em> is within range [0,255] (<em>csiz</em> &lt; 257) or [0,16383] (<em>csiz</em> &gt;= 257)</td>
3530 </tr>
3531 <tr class="odd">
3532 <td style="text-align: left;">roiStyleIsValid</td>
3533 <td style="text-align: left;"><em>roiStyle</em> equals 0 (“Implicit ROI (maximum shift)”)</td>
3534 </tr>
3535 <tr class="even">
3536 <td style="text-align: left;">roiShiftIsValid</td>
3537 <td style="text-align: left;"><em>roiShift</em> is within range [0,255]</td>
3538 </tr>
3539 </tbody>
3540 </table>
3541
3542
3543 <h2 id="qcd-marker">Quantization default (QCD) marker segment</h2>
3544
3545
3546 <h3 id="element-name-24">Element name</h3>
3547
3548
3549 <p>qcd</p>
3550
3551
3552 <h3 id="reported-properties-24">Reported properties</h3>
3553
3554
3555 <table>
3556 <thead>
3557 <tr class="header">
3558 <th style="text-align: left;">Property</th>
3559 <th style="text-align: left;">Description</th>
3560 </tr>
3561 </thead>
3562 <tbody>
3563 <tr class="odd">
3564 <td style="text-align: left;">lqcd</td>
3565 <td style="text-align: left;">Length of QCD marker segment in bytes</td>
3566 </tr>
3567 <tr class="even">
3568 <td style="text-align: left;">qStyle</td>
3569 <td style="text-align: left;">Quantization style for all components</td>
3570 </tr>
3571 <tr class="odd">
3572 <td style="text-align: left;">guardBits</td>
3573 <td style="text-align: left;">Number of guard bits</td>
3574 </tr>
3575 <tr class="even">
3576 <td style="text-align: left;">epsilon<sup>*</sup></td>
3577 <td style="text-align: left;">- If <em>qStyle</em> equals 0 (“no quantization”): <em>Epsilon</em> exponent in Eq E-5 of ISO/IEC 15444-1 (repeated for all decomposition levels; order: low to high)<br/>- If <em>qStyle</em> equals 1 (“scalar derived”): <em>Epsilon</em> exponent in Eq E-3 of ISO/IEC 15444-1<br/>- If <em>qStyle</em> equals 2 (“scalar expounded”): <em>Epsilon</em> exponent in Eq E-3 of ISO/IEC 15444-1 (repeated for all decomposition levels; order: low to high)</td>
3578 </tr>
3579 <tr class="odd">
3580 <td style="text-align: left;">mu<sup>*</sup></td>
3581 <td style="text-align: left;">- If <em>qStyle</em> equals 1 (“scalar derived”): <em>mu</em> constant in Eq E-3 of ISO/IEC 15444-1<br/>- if <em>qStyle</em> equals 2 (“scalar expounded”) : <em>mu</em> constant in Eq E-3 of ISO/IEC 15444-1 (repeated for all decomposition levels; order: low to high)</td>
3582 </tr>
3583 </tbody>
3584 </table>
3585
3586
3587 <h3 id="tests-23">Tests</h3>
3588
3589
3590 <table>
3591 <thead>
3592 <tr class="header">
3593 <th style="text-align: left;">Test name</th>
3594 <th style="text-align: left;">True if</th>
3595 </tr>
3596 </thead>
3597 <tbody>
3598 <tr class="odd">
3599 <td style="text-align: left;">lqcdIsValid</td>
3600 <td style="text-align: left;"><em>lqcd</em> is within range [4,197]</td>
3601 </tr>
3602 <tr class="even">
3603 <td style="text-align: left;">qStyleIsValid</td>
3604 <td style="text-align: left;"><em>qStyle</em> equals 0 (“no quantization”), 1 (“scalar derived”), or 2 (“scalar expounded”)</td>
3605 </tr>
3606 </tbody>
3607 </table>
3608
3609
3610 <h2 id="qcc-marker">Quantization component (QCC) marker segment</h2>
3611
3612
3613 <h3 id="element-name-25">Element name</h3>
3614
3615
3616 <p>qcc</p>
3617
3618
3619 <h3 id="reported-properties-25">Reported properties</h3>
3620
3621
3622 <table>
3623 <thead>
3624 <tr class="header">
3625 <th style="text-align: left;">Property</th>
3626 <th style="text-align: left;">Description</th>
3627 </tr>
3628 </thead>
3629 <tbody>
3630 <tr class="odd">
3631 <td style="text-align: left;">lqcc</td>
3632 <td style="text-align: left;">Length of QCC marker segment in bytes</td>
3633 </tr>
3634 <tr class="even">
3635 <td style="text-align: left;">cqcc</td>
3636 <td style="text-align: left;">Index of the component to which this marker segment relates</td>
3637 </tr>
3638 <tr class="odd">
3639 <td style="text-align: left;">qStyle</td>
3640 <td style="text-align: left;">Quantization style for all components</td>
3641 </tr>
3642 <tr class="even">
3643 <td style="text-align: left;">guardBits</td>
3644 <td style="text-align: left;">Number of guard bits</td>
3645 </tr>
3646 <tr class="odd">
3647 <td style="text-align: left;">epsilon<sup>*</sup></td>
3648 <td style="text-align: left;">- If <em>qStyle</em> equals 0 (“no quantization”): <em>Epsilon</em> exponent in Eq E-5 of ISO/IEC 15444-1 (repeated for all decomposition levels; order: low to high)<br/>- If <em>qStyle</em> equals 1 (“scalar derived”): <em>Epsilon</em> exponent in Eq E-3 of ISO/IEC 15444-1<br/>- If <em>qStyle</em> equals 2 (“scalar expounded”): <em>Epsilon</em> exponent in Eq E-3 of ISO/IEC 15444-1 (repeated for all decomposition levels; order: low to high)</td>
3649 </tr>
3650 <tr class="even">
3651 <td style="text-align: left;">mu<sup>*</sup></td>
3652 <td style="text-align: left;">- If <em>qStyle</em> equals 1 (“scalar derived”): <em>mu</em> constant in Eq E-3 of ISO/IEC 15444-1<br/>- if <em>qStyle</em> equals 2 (“scalar expounded”) : <em>mu</em> constant in Eq E-3 of ISO/IEC 15444-1 (repeated for all decomposition levels; order: low to high)</td>
3653 </tr>
3654 </tbody>
3655 </table>
3656
3657
3658 <h3 id="tests-24">Tests</h3>
3659
3660
3661 <table>
3662 <thead>
3663 <tr class="header">
3664 <th style="text-align: left;">Test name</th>
3665 <th style="text-align: left;">True if</th>
3666 </tr>
3667 </thead>
3668 <tbody>
3669 <tr class="odd">
3670 <td style="text-align: left;">lqccIsValid</td>
3671 <td style="text-align: left;"><em>lqcc</em> is within range [5,199]</td>
3672 </tr>
3673 <tr class="even">
3674 <td style="text-align: left;">qStyleIsValid</td>
3675 <td style="text-align: left;"><em>qStyle</em> equals 0 (“no quantization”), 1 (“scalar derived”), or 2 (“scalar expounded”)</td>
3676 </tr>
3677 </tbody>
3678 </table>
3679
3680
3681 <h2 id="poc-marker">Progression order change (POC) marker segment</h2>
3682
3683
3684 <h3 id="element-name-26">Element name</h3>
3685
3686
3687 <p>poc</p>
3688
3689
3690 <h3 id="reported-properties-26">Reported properties</h3>
3691
3692
3693 <table>
3694 <thead>
3695 <tr class="header">
3696 <th style="text-align: left;">Property</th>
3697 <th style="text-align: left;">Description</th>
3698 </tr>
3699 </thead>
3700 <tbody>
3701 <tr class="odd">
3702 <td style="text-align: left;">lpoc</td>
3703 <td style="text-align: left;">Length of POC marker segment in bytes</td>
3704 </tr>
3705 <tr class="even">
3706 <td style="text-align: left;">rspoc<sup>*</sup></td>
3707 <td style="text-align: left;">Resolution level index for the start of a progression (repeated for all progression order changes)</td>
3708 </tr>
3709 <tr class="odd">
3710 <td style="text-align: left;">cspoc<sup>*</sup></td>
3711 <td style="text-align: left;">Component index for the start of a progression (repeated for all progression order changes)</td>
3712 </tr>
3713 <tr class="even">
3714 <td style="text-align: left;">lyepoc<sup>*</sup></td>
3715 <td style="text-align: left;">Layer index for the end of a progression (repeated for all progression order changes)</td>
3716 </tr>
3717 <tr class="odd">
3718 <td style="text-align: left;">repoc<sup>*</sup></td>
3719 <td style="text-align: left;">Resolution level index for the end of a progression (repeated for all progression order changes)</td>
3720 </tr>
3721 <tr class="even">
3722 <td style="text-align: left;">cepoc<sup>*</sup></td>
3723 <td style="text-align: left;">Component index for the end of a progression (repeated for all progression order changes)</td>
3724 </tr>
3725 <tr class="odd">
3726 <td style="text-align: left;">order<sup>*</sup></td>
3727 <td style="text-align: left;">Progression order (repeated for all progression order changes)</td>
3728 </tr>
3729 </tbody>
3730 </table>
3731
3732
3733 <h3 id="tests-25">Tests</h3>
3734
3735
3736 <table>
3737 <thead>
3738 <tr class="header">
3739 <th style="text-align: left;">Test name</th>
3740 <th style="text-align: left;">True if</th>
3741 </tr>
3742 </thead>
3743 <tbody>
3744 <tr class="odd">
3745 <td style="text-align: left;">lpocIsValid</td>
3746 <td style="text-align: left;"><em>lpoc</em> is within range [9,65535]</td>
3747 </tr>
3748 <tr class="even">
3749 <td style="text-align: left;">rspocIsValid<sup>*</sup></td>
3750 <td style="text-align: left;"><em>rspoc</em> is within range [0,32] (repeated for all progression order changes)</td>
3751 </tr>
3752 <tr class="odd">
3753 <td style="text-align: left;">cspocIsValid<sup>*</sup></td>
3754 <td style="text-align: left;"><em>cspoc</em> is within range [0,255] (<em>csiz</em> &lt; 257) or [0,16383] (*csiz &gt;= 257) (repeated for all progression order changes)</td>
3755 </tr>
3756 <tr class="even">
3757 <td style="text-align: left;">lyepocIsValid<sup>*</sup></td>
3758 <td style="text-align: left;"><em>lyepoc</em> is within range [1,65535] (repeated for all progression order changes)</td>
3759 </tr>
3760 <tr class="odd">
3761 <td style="text-align: left;">repocIsValid<sup>*</sup></td>
3762 <td style="text-align: left;"><em>repoc</em> is within range [(<em>rspoc</em> + 1),65535] (repeated for all progression order changes)</td>
3763 </tr>
3764 <tr class="even">
3765 <td style="text-align: left;">cepocIsValid<sup>*</sup></td>
3766 <td style="text-align: left;"><em>cepoc</em> is within range [(<em>cspoc</em> + 1),255] (<em>csiz</em> &lt; 257) or [(<em>cspoc</em> + 1),16384] (*csiz &gt;= 257), or 0 (repeated for all progression order changes)</td>
3767 </tr>
3768 <tr class="odd">
3769 <td style="text-align: left;">orderIsValid<sup>*</sup></td>
3770 <td style="text-align: left;"><em>order</em> equals 0 (“LRCP”), 1 (“RLCP”), 2 (“RPCL”), 3 (“PCRL”) or 4 (“CPRL”) (repeated for all progression order changes)</td>
3771 </tr>
3772 </tbody>
3773 </table>
3774
3775
3776 <h2 id="crg-marker">Component registration (CRG) marker segment</h2>
3777
3778
3779 <h3 id="element-name-27">Element name</h3>
3780
3781
3782 <p>crg</p>
3783
3784
3785 <h3 id="reported-properties-27">Reported properties</h3>
3786
3787
3788 <table>
3789 <thead>
3790 <tr class="header">
3791 <th style="text-align: left;">Property</th>
3792 <th style="text-align: left;">Description</th>
3793 </tr>
3794 </thead>
3795 <tbody>
3796 <tr class="odd">
3797 <td style="text-align: left;">lcrg</td>
3798 <td style="text-align: left;">Length of CRG marker segment in bytes</td>
3799 </tr>
3800 <tr class="even">
3801 <td style="text-align: left;">xrg<sup>*</sup></td>
3802 <td style="text-align: left;">Horizontal offset, in units of 1/65536 of <em>xRsiz</em> (repeated for all components)</td>
3803 </tr>
3804 <tr class="odd">
3805 <td style="text-align: left;">yrg<sup>*</sup></td>
3806 <td style="text-align: left;">Vertical offset, in units of 1/65536 of <em>yRsiz</em> (repeated for all components)</td>
3807 </tr>
3808 </tbody>
3809 </table>
3810
3811
3812 <h3 id="tests-26">Tests</h3>
3813
3814
3815 <table>
3816 <thead>
3817 <tr class="header">
3818 <th style="text-align: left;">Test name</th>
3819 <th style="text-align: left;">True if</th>
3820 </tr>
3821 </thead>
3822 <tbody>
3823 <tr class="odd">
3824 <td style="text-align: left;">lcrgIsValid</td>
3825 <td style="text-align: left;"><em>lcrg</em> is within range [6,65534]</td>
3826 </tr>
3827 <tr class="even">
3828 <td style="text-align: left;">xcrgIsValid<sup>*</sup></td>
3829 <td style="text-align: left;"><em>xcrg</em> is within range [0,65535] (repeated for all components)</td>
3830 </tr>
3831 <tr class="odd">
3832 <td style="text-align: left;">ycrgIsValid<sup>*</sup></td>
3833 <td style="text-align: left;"><em>ycrg</em> is within range [0,65535] (repeated for all components)</td>
3834 </tr>
3835 </tbody>
3836 </table>
3837
3838
3839 <h2 id="com-marker">Comment (COM) marker segment</h2>
3840
3841
3842 <h3 id="element-name-28">Element name</h3>
3843
3844
3845 <p>com</p>
3846
3847
3848 <h3 id="reported-properties-28">Reported properties</h3>
3849
3850
3851 <table>
3852 <thead>
3853 <tr class="header">
3854 <th style="text-align: left;">Property</th>
3855 <th style="text-align: left;">Description</th>
3856 </tr>
3857 </thead>
3858 <tbody>
3859 <tr class="odd">
3860 <td style="text-align: left;">lcom</td>
3861 <td style="text-align: left;">Length of COM marker segment in bytes</td>
3862 </tr>
3863 <tr class="even">
3864 <td style="text-align: left;">rcom</td>
3865 <td style="text-align: left;">Registration value of marker segment (indicates whether this comment contains binary data or text)</td>
3866 </tr>
3867 <tr class="odd">
3868 <td style="text-align: left;">comment</td>
3869 <td style="text-align: left;">Embedded comment as text (only if <em>rcom</em> = 1 )</td>
3870 </tr>
3871 </tbody>
3872 </table>
3873
3874
3875 <h3 id="tests-27">Tests</h3>
3876
3877
3878 <table>
3879 <thead>
3880 <tr class="header">
3881 <th style="text-align: left;">Test name</th>
3882 <th style="text-align: left;">True if</th>
3883 </tr>
3884 </thead>
3885 <tbody>
3886 <tr class="odd">
3887 <td style="text-align: left;">lcomIsValid</td>
3888 <td style="text-align: left;"><em>lqcd</em> is within range [5,65535]</td>
3889 </tr>
3890 <tr class="even">
3891 <td style="text-align: left;">rcomIsValid</td>
3892 <td style="text-align: left;"><em>rcom</em> equals 0 (“binary”) or 1 (“ISO/IEC 8859-15 (Latin”))</td>
3893 </tr>
3894 <tr class="odd">
3895 <td style="text-align: left;">commentIsValid</td>
3896 <td style="text-align: left;">Comment is valid ISO/IEC8859-15 and does not contain control characters, other than tab, newline or carriage return</td>
3897 </tr>
3898 </tbody>
3899 </table>
3900
3901
3902 <h2 id="tile-part">Tile part (child of Contiguous Codestream box)</h2>
3903
3904
3905 <p>Tile-part level properties and tests. This is not a box or a marker segment!</p>
3906
3907
3908 <h3 id="element-name-29">Element name</h3>
3909
3910
3911 <p>tilePart (child of tileParts)</p>
3912
3913
3914 <h3 id="reported-properties-29">Reported properties</h3>
3915
3916
3917 <p>Each tile part element can contain a number of child elements:</p>
3918
3919
3920 <table>
3921 <thead>
3922 <tr class="header">
3923 <th style="text-align: left;">Child element</th>
3924 <th style="text-align: left;">Description</th>
3925 </tr>
3926 </thead>
3927 <tbody>
3928 <tr class="odd">
3929 <td style="text-align: left;"><a href="#sot-marker">sot</a></td>
3930 <td style="text-align: left;">Properties from start of tile (SOT) marker segment</td>
3931 </tr>
3932 <tr class="even">
3933 <td style="text-align: left;"><a href="#cod-marker">cod</a></td>
3934 <td style="text-align: left;">Properties from the (optional) coding style default (COD) marker segment (tile part header)</td>
3935 </tr>
3936 <tr class="odd">
3937 <td style="text-align: left;"><a href="#coc-marker">coc</a></td>
3938 <td style="text-align: left;">Properties from the (optional) coding style component (COC) marker segment (tile part header)</td>
3939 </tr>
3940 <tr class="even">
3941 <td style="text-align: left;"><a href="#rgn-marker">rgn</a></td>
3942 <td style="text-align: left;">Properties from the (optional) region of interest (RGN) marker segment (tile part header)</td>
3943 </tr>
3944 <tr class="odd">
3945 <td style="text-align: left;"><a href="#qcd-marker">qcd</a></td>
3946 <td style="text-align: left;">Properties from the (optional) quantization default (QCD) marker segment (tile part header)</td>
3947 </tr>
3948 <tr class="even">
3949 <td style="text-align: left;"><a href="#qcc-marker">qcc</a></td>
3950 <td style="text-align: left;">Properties from the (optional) quantization component (QCC) marker segment (tile part header)</td>
3951 </tr>
3952 <tr class="odd">
3953 <td style="text-align: left;"><a href="#poc-marker">poc</a></td>
3954 <td style="text-align: left;">Properties from the (optional) progression order change (POC) marker segment (tile part header)</td>
3955 </tr>
3956 <tr class="even">
3957 <td style="text-align: left;"><a href="#com-marker">com</a></td>
3958 <td style="text-align: left;">Properties from the (optional) comment (COM) marker segment (tile part header)</td>
3959 </tr>
3960 <tr class="odd">
3961 <td style="text-align: left;"><a href="#plt-marker">plt</a></td>
3962 <td style="text-align: left;">Properties from the (optional) packet length (PLT) marker(tile part header)</td>
3963 </tr>
3964 <tr class="even">
3965 <td style="text-align: left;"><a href="#ppt-marker">ppt</a></td>
3966 <td style="text-align: left;">Properties from the (optional) packed packet headers(PPT) marker segment (tile part header)</td>
3967 </tr>
3968 </tbody>
3969 </table>
3970
3971
3972 <p>Note that the <em>plt</em> and <em>ppt</em> elements are only written if the <code>--packetmarkers</code> option is used. The number of PLT and PPT markers is given by the following 2 derived properties (these are always reported, irrespective of <code>--packetmarkers</code>):</p>
3973
3974
3975 <table>
3976 <thead>
3977 <tr class="header">
3978 <th style="text-align: left;">Property</th>
3979 <th style="text-align: left;">Description</th>
3980 </tr>
3981 </thead>
3982 <tbody>
3983 <tr class="odd">
3984 <td style="text-align: left;">pltCount</td>
3985 <td style="text-align: left;">Number of PLT markers in tile part header</td>
3986 </tr>
3987 <tr class="even">
3988 <td style="text-align: left;">pptCount</td>
3989 <td style="text-align: left;">Number of PPT markers in tile part header</td>
3990 </tr>
3991 </tbody>
3992 </table>
3993
3994
3995 <h3 id="tests-28">Tests</h3>
3996
3997
3998 <table>
3999 <thead>
4000 <tr class="header">
4001 <th style="text-align: left;">Test name</th>
4002 <th style="text-align: left;">True if</th>
4003 </tr>
4004 </thead>
4005 <tbody>
4006 <tr class="odd">
4007 <td style="text-align: left;">foundNextTilePartOrEOC</td>
4008 <td style="text-align: left;">Tile part start offset + <em>tilePartLength</em> points to either start of new tile or EOC marker (useful for detecting within-codestream byte corruption)</td>
4009 </tr>
4010 <tr class="even">
4011 <td style="text-align: left;">foundSODMarker</td>
4012 <td style="text-align: left;">Last marker segment of tile part is a start-of-data (SOD) marker</td>
4013 </tr>
4014 </tbody>
4015 </table>
4016
4017
4018 <h2 id="sot-marker">Start of tile part (SOT) marker segment (child of tile part)</h2>
4019
4020
4021 <h3 id="element-name-30">Element name</h3>
4022
4023
4024 <p>sot</p>
4025
4026
4027 <h3 id="reported-properties-30">Reported properties</h3>
4028
4029
4030 <table>
4031 <thead>
4032 <tr class="header">
4033 <th style="text-align: left;">Property</th>
4034 <th style="text-align: left;">Description</th>
4035 </tr>
4036 </thead>
4037 <tbody>
4038 <tr class="odd">
4039 <td style="text-align: left;">lsot</td>
4040 <td style="text-align: left;">Length of SOT marker segment in bytes</td>
4041 </tr>
4042 <tr class="even">
4043 <td style="text-align: left;">isot</td>
4044 <td style="text-align: left;">Tile index</td>
4045 </tr>
4046 <tr class="odd">
4047 <td style="text-align: left;">psot</td>
4048 <td style="text-align: left;">Length of tile part</td>
4049 </tr>
4050 <tr class="even">
4051 <td style="text-align: left;">tpsot</td>
4052 <td style="text-align: left;">Tile part index</td>
4053 </tr>
4054 <tr class="odd">
4055 <td style="text-align: left;">tnsot</td>
4056 <td style="text-align: left;">Number of tile-parts of a tile in the codestream (value of 0 indicates that number of tile-parts of tile in the codestream is not defined in current header)</td>
4057 </tr>
4058 </tbody>
4059 </table>
4060
4061
4062 <h3 id="tests-29">Tests</h3>
4063
4064
4065 <table>
4066 <thead>
4067 <tr class="header">
4068 <th style="text-align: left;">Test name</th>
4069 <th style="text-align: left;">True if</th>
4070 </tr>
4071 </thead>
4072 <tbody>
4073 <tr class="odd">
4074 <td style="text-align: left;">lsotIsValid</td>
4075 <td style="text-align: left;"><em>lsot</em> equals 10</td>
4076 </tr>
4077 <tr class="even">
4078 <td style="text-align: left;">isotIsValid</td>
4079 <td style="text-align: left;"><em>isot</em> is within range [0,65534]</td>
4080 </tr>
4081 <tr class="odd">
4082 <td style="text-align: left;">psotIsValid</td>
4083 <td style="text-align: left;"><em>psot</em> is <strong>not</strong> within range [1,13]</td>
4084 </tr>
4085 <tr class="even">
4086 <td style="text-align: left;">tpsotIsValid</td>
4087 <td style="text-align: left;"><em>tpsot</em> is within range [0,254]</td>
4088 </tr>
4089 </tbody>
4090 </table>
4091
4092
4093 <p><br/></p>
4094
4095
4096 <p>The following marker segments are only minimally supported: <em>jpylyzer</em> will report their presence in the <em>properties</em> element, but it does not perform any further tests or analyses. This may change in upcoming versions of the software.</p>
4097
4098
4099 <h2 id="tlm-marker">Tile-part lengths (TLM) marker segment</h2>
4100
4101
4102 <h3 id="element-name-31">Element name</h3>
4103
4104
4105 <p>tlm</p>
4106
4107
4108 <h3 id="reported-properties-31">Reported properties</h3>
4109
4110
4111 <table>
4112 <thead>
4113 <tr class="header">
4114 <th style="text-align: left;">Property</th>
4115 <th style="text-align: left;">Description</th>
4116 </tr>
4117 </thead>
4118 <tbody>
4119 <tr class="odd">
4120 <td style="text-align: left;"/>
4121 <td style="text-align: left;"/>
4122 </tr>
4123 <tr class="even">
4124 <td style="text-align: left;"/>
4125 <td style="text-align: left;"/>
4126 </tr>
4127 </tbody>
4128 </table>
4129
4130
4131 <h3 id="tests-30">Tests</h3>
4132
4133
4134 <table>
4135 <thead>
4136 <tr class="header">
4137 <th style="text-align: left;">Test name</th>
4138 <th style="text-align: left;">True if</th>
4139 </tr>
4140 </thead>
4141 <tbody>
4142 <tr class="odd">
4143 <td style="text-align: left;"/>
4144 <td style="text-align: left;"/>
4145 </tr>
4146 <tr class="even">
4147 <td style="text-align: left;"/>
4148 <td style="text-align: left;"/>
4149 </tr>
4150 </tbody>
4151 </table>
4152
4153
4154 <h2 id="plm-marker">Packet length, main header (PLM) marker segment</h2>
4155
4156
4157 <h3 id="element-name-32">Element name</h3>
4158
4159
4160 <p>plm</p>
4161
4162
4163 <h3 id="reported-properties20">Reported properties<a href="#fn18" class="footnote-ref" id="fnref18" role="doc-noteref"><sup>18</sup></a></h3>
4164
4165
4166 <table>
4167 <thead>
4168 <tr class="header">
4169 <th style="text-align: left;">Property</th>
4170 <th style="text-align: left;">Description</th>
4171 </tr>
4172 </thead>
4173 <tbody>
4174 <tr class="odd">
4175 <td style="text-align: left;">lplm</td>
4176 <td style="text-align: left;">Length of PLM marker segment in bytes</td>
4177 </tr>
4178 <tr class="even">
4179 <td style="text-align: left;">zplm</td>
4180 <td style="text-align: left;">PLM marker segment index</td>
4181 </tr>
4182 <tr class="odd">
4183 <td style="text-align: left;">nplm</td>
4184 <td style="text-align: left;">Number of bytes of Iplm information for the ith tile-part</td>
4185 </tr>
4186 <tr class="even">
4187 <td style="text-align: left;">iplm</td>
4188 <td style="text-align: left;">Comma separated list of packet length values (as hexadecimal strings)</td>
4189 </tr>
4190 </tbody>
4191 </table>
4192
4193
4194 <h3 id="tests-31">Tests</h3>
4195
4196
4197 <table>
4198 <thead>
4199 <tr class="header">
4200 <th style="text-align: left;">Test name</th>
4201 <th style="text-align: left;">True if</th>
4202 </tr>
4203 </thead>
4204 <tbody>
4205 <tr class="odd">
4206 <td style="text-align: left;"/>
4207 <td style="text-align: left;"/>
4208 </tr>
4209 <tr class="even">
4210 <td style="text-align: left;"/>
4211 <td style="text-align: left;"/>
4212 </tr>
4213 </tbody>
4214 </table>
4215
4216
4217 <h2 id="ppm-marker">Packed packet headers, main header (PPM) marker segment</h2>
4218
4219
4220 <h3 id="element-name-33">Element name</h3>
4221
4222
4223 <p>ppm</p>
4224
4225
4226 <h3 id="reported-properties20-1">Reported properties<a href="#fn19" class="footnote-ref" id="fnref19" role="doc-noteref"><sup>19</sup></a></h3>
4227
4228
4229 <table>
4230 <thead>
4231 <tr class="header">
4232 <th style="text-align: left;">Property</th>
4233 <th style="text-align: left;">Description</th>
4234 </tr>
4235 </thead>
4236 <tbody>
4237 <tr class="odd">
4238 <td style="text-align: left;"/>
4239 <td style="text-align: left;"/>
4240 </tr>
4241 <tr class="even">
4242 <td style="text-align: left;"/>
4243 <td style="text-align: left;"/>
4244 </tr>
4245 </tbody>
4246 </table>
4247
4248
4249 <h3 id="tests-32">Tests</h3>
4250
4251
4252 <table>
4253 <thead>
4254 <tr class="header">
4255 <th style="text-align: left;">Test name</th>
4256 <th style="text-align: left;">True if</th>
4257 </tr>
4258 </thead>
4259 <tbody>
4260 <tr class="odd">
4261 <td style="text-align: left;"/>
4262 <td style="text-align: left;"/>
4263 </tr>
4264 <tr class="even">
4265 <td style="text-align: left;"/>
4266 <td style="text-align: left;"/>
4267 </tr>
4268 </tbody>
4269 </table>
4270
4271
4272 <h2 id="plt-marker">Packet length, tile-part header (PLT) marker segment</h2>
4273
4274
4275 <h3 id="element-name-34">Element name</h3>
4276
4277
4278 <p>plt</p>
4279
4280
4281 <h3 id="reported-properties20-2">Reported properties<a href="#fn20" class="footnote-ref" id="fnref20" role="doc-noteref"><sup>20</sup></a></h3>
4282
4283
4284 <table>
4285 <thead>
4286 <tr class="header">
4287 <th style="text-align: left;">Property</th>
4288 <th style="text-align: left;">Description</th>
4289 </tr>
4290 </thead>
4291 <tbody>
4292 <tr class="odd">
4293 <td style="text-align: left;">lplt</td>
4294 <td style="text-align: left;">Length of PLT marker segment in bytes</td>
4295 </tr>
4296 <tr class="even">
4297 <td style="text-align: left;">zplt</td>
4298 <td style="text-align: left;">PLT marker segment index</td>
4299 </tr>
4300 <tr class="odd">
4301 <td style="text-align: left;">nplm</td>
4302 <td style="text-align: left;">Number of bytes of Iplm information for the ith tile-part</td>
4303 </tr>
4304 <tr class="even">
4305 <td style="text-align: left;">iplt</td>
4306 <td style="text-align: left;">Comma separated list of packet length values (as hexadecimal strings)</td>
4307 </tr>
4308 </tbody>
4309 </table>
4310
4311
4312 <h3 id="tests-33">Tests</h3>
4313
4314
4315 <table>
4316 <thead>
4317 <tr class="header">
4318 <th style="text-align: left;">Test name</th>
4319 <th style="text-align: left;">True if</th>
4320 </tr>
4321 </thead>
4322 <tbody>
4323 <tr class="odd">
4324 <td style="text-align: left;"/>
4325 <td style="text-align: left;"/>
4326 </tr>
4327 <tr class="even">
4328 <td style="text-align: left;"/>
4329 <td style="text-align: left;"/>
4330 </tr>
4331 </tbody>
4332 </table>
4333
4334
4335 <h2 id="ppt-marker">Packed packet headers, tile-part header (PPT) marker segment</h2>
4336
4337
4338 <h3 id="element-name-35">Element name</h3>
4339
4340
4341 <p>ppt</p>
4342
4343
4344 <h3 id="reported-properties20-3">Reported properties<a href="#fn21" class="footnote-ref" id="fnref21" role="doc-noteref"><sup>21</sup></a></h3>
4345
4346
4347 <table>
4348 <thead>
4349 <tr class="header">
4350 <th style="text-align: left;">Property</th>
4351 <th style="text-align: left;">Description</th>
4352 </tr>
4353 </thead>
4354 <tbody>
4355 <tr class="odd">
4356 <td style="text-align: left;"/>
4357 <td style="text-align: left;"/>
4358 </tr>
4359 <tr class="even">
4360 <td style="text-align: left;"/>
4361 <td style="text-align: left;"/>
4362 </tr>
4363 </tbody>
4364 </table>
4365
4366
4367 <h3 id="tests-34">Tests</h3>
4368
4369
4370 <table>
4371 <thead>
4372 <tr class="header">
4373 <th style="text-align: left;">Test name</th>
4374 <th style="text-align: left;">True if</th>
4375 </tr>
4376 </thead>
4377 <tbody>
4378 <tr class="odd">
4379 <td style="text-align: left;"/>
4380 <td style="text-align: left;"/>
4381 </tr>
4382 <tr class="even">
4383 <td style="text-align: left;"/>
4384 <td style="text-align: left;"/>
4385 </tr>
4386 </tbody>
4387 </table>
4388
4389
4390 <h1 id="references">References</h1>
4391
4392
4393 <p>ICC. Specification ICC.1:1998-09 – File Format for Color Profiles. International Color Consortium, 1998. <a href="https://www.color.org/ICC-1_1998-09.pdf">https://www.color.org/ICC-1_1998-09.pdf</a>.</p>
4394
4395
4396 <p>ISO/IEC. Information technology — JPEG 2000 image coding system: Core coding system. ISO/IEC 15444-1, Second edition. Geneva: ISO/IEC, 2004a. <a href="https://www.jpeg.org/public/15444-1annexi.pdf">https://www.jpeg.org/public/15444-1annexi.pdf</a> (“Annex I: JP2 file format syntax” only).</p>
4397
4398
4399 <p>ISO/IEC. Information technology — JPEG 2000 image coding system: Extensions. ISO/IEC 15444-2, First edition. Geneva: ISO/IEC, 2004b. <a href="https://www.jpeg.org/public/15444-2annexm.pdf">https://www.jpeg.org/public/15444-2annexm.pdf</a> (“Annex M: JPX extended file format syntax” only).</p>
4400
4401
4402 <p>Leach, P., Mealling, M. &amp; Salz, R. A Universally Unique IDentifier (UUID) URN namespace. Memo, IETF. <a href="https://tools.ietf.org/html/rfc4122.html">https://tools.ietf.org/html/rfc4122.html</a>.</p>
4403
4404
4405 <section class="footnotes" role="doc-endnotes">
4406 <hr/>
4407 <ol>
4408 <li id="fn1" role="doc-endnote"><p>The <em>jpylyzer</em> binaries were created using the <em>PyInstaller</em> package: <a href="https://www.pyinstaller.org/">https://www.pyinstaller.org/</a><a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4409 <li id="fn2" role="doc-endnote"><p>Note that <em>jpylyzer</em> versions 1.8 and earlier returned a formatted XML string instead of an element object!<a href="#fnref2" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4410 <li id="fn3" role="doc-endnote"><p>Note that <em>jpylyzer</em> versions 1.4 and earlier used the verbose output format by default. This behaviour has changed in version 1.5 onwards, as the lengthy output turned out to be slightly confusing to some users.<a href="#fnref3" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4411 <li id="fn4" role="doc-endnote"><p>The “Any ICC” method is defined in ISO/IEC 15444-2 (the JPX format), and is not allowed in JP2. However, <em>jpylyzer</em> offers limited support for JPX here by also reporting the properties of ICC profiles that were embedded using this method. Note that any file that uses this method will fail the “methIsValid” test (and thereby the validation).<a href="#fnref4" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4412 <li id="fn5" role="doc-endnote"><p>Originally ISO/IEC 15444-1 only allowed “input device” profiles. Support of “display device” profiles was added through an <a href="http://www.itu.int/rec/T-REC-T.800-201303-P!Amd6/en">amendment</a> to the standard in 2013. The behaviour of <em>jpylyzer</em> is consistent with this amendment.<a href="#fnref5" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4413 <li id="fn6" role="doc-endnote"><p>Calculated as: <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mfrac> <mrow> <mi>vRcN</mi> </mrow> <mrow> <mi>vRcD</mi> </mrow> </mfrac> <mo>•</mo> <msup> <mn>10</mn> <mi>vRcE</mi> </msup> </mrow> </math><a href="#fnref6" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4414 <li id="fn7" role="doc-endnote"><p>Calculated as: <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mfrac> <mrow> <mi>hRcN</mi> </mrow> <mrow> <mi>hRcD</mi> </mrow> </mfrac> <mo>•</mo> <msup> <mn>10</mn> <mi>hRcE</mi> </msup> </mrow> </math><a href="#fnref7" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4415 <li id="fn8" role="doc-endnote"><p>Calculated as: <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>vRescInPixelsPerMeter</mi> <mo>•</mo> <mn>25.4</mn> <mo>•</mo> <msup> <mn>10</mn> <mi>-3</mi> </msup> </mrow> </math><a href="#fnref8" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4416 <li id="fn9" role="doc-endnote"><p>Calculated as: <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>hRescInPixelsPerMeter</mi> <mo>•</mo> <mn>25.4</mn> <mo>•</mo> <msup> <mn>10</mn> <mi>-3</mi> </msup> </mrow> </math><a href="#fnref9" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4417 <li id="fn10" role="doc-endnote"><p>Calculated as: <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mfrac> <mrow> <mi>vRdN</mi> </mrow> <mrow> <mi>vRdD</mi> </mrow> </mfrac> <mo>•</mo> <msup> <mn>10</mn> <mi>vRdE</mi> </msup> </mrow> </math><a href="#fnref10" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4418 <li id="fn11" role="doc-endnote"><p>Calculated as: <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mfrac> <mrow> <mi>hRdN</mi> </mrow> <mrow> <mi>hRdD</mi> </mrow> </mfrac> <mo>•</mo> <msup> <mn>10</mn> <mi>hRdE</mi> </msup> </mrow> </math><a href="#fnref11" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4419 <li id="fn12" role="doc-endnote"><p>Calculated as: <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>vResdInPixelsPerMeter</mi> <mo>•</mo> <mn>25.4</mn> <mo>•</mo> <msup> <mn>10</mn> <mi>-3</mi> </msup> </mrow> </math><a href="#fnref12" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4420 <li id="fn13" role="doc-endnote"><p>Calculated as: <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>hResdInPixelsPerMeter</mi> <mo>•</mo> <mn>25.4</mn> <mo>•</mo> <msup> <mn>10</mn> <mi>-3</mi> </msup> </mrow> </math><a href="#fnref13" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4421 <li id="fn14" role="doc-endnote"><p>Link: <a href="https://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/cs6/XMPSpecificationPart3.pdf">https://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/cs6/XMPSpecificationPart3.pdf</a><a href="#fnref14" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4422 <li id="fn15" role="doc-endnote"><p>However, support for start of packet (SOP) and end of packet (EPH) markers may be included in future versions.<a href="#fnref15" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4423 <li id="fn16" role="doc-endnote"><p>For example, in a TIFF to JP2 conversion workflow one could include a pixel-by-pixel comparison of the values in the TIFF and the JP2.<a href="#fnref16" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4424 <li id="fn17" role="doc-endnote"><p>Calculated as: <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>numberOfTiles</mi> <mo>=</mo> <mo>[</mo> <mfrac> <mrow> <mi>xsiz</mi> <mo>-</mo> <mi>xOsiz</mi> </mrow> <mrow> <mi>xTsiz</mi> </mrow> </mfrac> <mo>]</mo> <mo>•</mo> <mo>[</mo> <mfrac> <mrow> <mi>ysiz</mi> <mo>-</mo> <mi>yOsiz</mi> </mrow> <mrow> <mi>yTsiz</mi> </mrow> </mfrac> <mo>]</mo> </mrow> </math><a href="#fnref17" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4425 <li id="fn18" role="doc-endnote"><p>Only reported if the <code>--packetmarkers</code> option is used.<a href="#fnref18" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4426 <li id="fn19" role="doc-endnote"><p>Only reported if the <code>--packetmarkers</code> option is used.<a href="#fnref19" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4427 <li id="fn20" role="doc-endnote"><p>Only reported if the <code>--packetmarkers</code> option is used.<a href="#fnref20" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4428 <li id="fn21" role="doc-endnote"><p>Only reported if the <code>--packetmarkers</code> option is used.<a href="#fnref21" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
4429 </ol>
4430 </section>
4431
4432