Skip to content

Commit 73d5b56

Browse files
author
Alex Dolski
committed
Upgrade Kakadu to 8.0.3 (closes cantaloupe-project#357)
1 parent 4d9bc2b commit 73d5b56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+899
-254
lines changed

CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
* XMP metadata can be copied or edited using a delegate method.
3838
* The `processor.metadata.respect_orientation` configuration key has been
3939
removed and EXIF Orientation values are always respected.
40+
* The included Kakadu library used by KakaduNativeProcessor has been updated
41+
to version 8.0.3.
4042
* KakaduNativeProcessor, OpenJpegProcessor, and TurboJpegProcessor respect the
4143
EXIF `Orientation` tag.
4244
* KakaduNativeProcessor and OpenJpegProcessor support IPTC and XMP metadata.

UPGRADING.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ current version.
4141
10. Note that the IIIF Image API 1.x endpoint no longer supports content
4242
negotiation. If a format extension is not supplied in the URI, JPEG will be
4343
returned regardless of the value of the `Accept` header.
44-
11. KakaduDemoProcessor is no longer available. If you were using it, you must
44+
11. If you are using KakaduNativeProcessor, you must install the updated Kakadu
45+
shared library, contained in the `deps` folder.
46+
12. KakaduDemoProcessor is no longer available. If you were using it, you must
4547
switch to either OpenJpegProcessor or KakaduNativeProcessor.
46-
12. Note that the `false` value supplied to the `cache` URL query argument
48+
13. Note that the `false` value supplied to the `cache` URL query argument
4749
(e.g. `?cache=false`) has been replaced by `nocache`. `false` can still be
4850
used, but it is deprecated and may be removed in a future version.
4951

-3.29 MB
Binary file not shown.
3.55 MB
Binary file not shown.

dist/deps/Linux-x86-64/lib/libkdu_jni.so

100755100644
10.5 KB
Binary file not shown.
-1.43 MB
Binary file not shown.
1.69 MB
Binary file not shown.

dist/deps/README.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ document for detailed terms of use.
1919
The Linux binaries were compiled on CentOS 7 x86 64-bit with gcc 4.8.5.
2020

2121
```
22+
export JAVA_HOME=/usr/lib/jvm/java
2223
cd coresys/make
2324
make -f Makefile-Linux-x86-64-gcc
2425
cd ../../managed/make
2526
make -f Makefile-Linux-x86-64-gcc
2627
cd ../../lib/Linux-x86-64-gcc
2728
28-
# Builds libkdu_vNXX.so & libkdu_jni.so
29-
# Java class files are in ../../../java/kdu_jni
29+
# Builds `libkdu_vNXX.so` & `libkdu_jni.so`
30+
# Java class files are in `../../../java/kdu_jni`
3031
```
3132

3233
## macOS
@@ -43,6 +44,9 @@ xcodebuild -project managed.xcodeproj -target kdu_jni -configuration Release
4344
# Java class files are in ../../java/kdu_jni
4445
```
4546

47+
(Future note: for Catalina, add `-UseModernBuildSystem=NO` to the `xcodebuild`
48+
commands.)
49+
4650
## Windows
4751

4852
The Windows binaries were compiled on Windows 7 SP1 64-bit with Visual
@@ -62,11 +66,12 @@ Studio Community 2015.
6266
2. Add the JDK headers to the include path
6367
1. Right-click on the `kdu_jni` solution
6468
2. Go to Properties -> VC++ Directories -> Include Directories
65-
3. Add path to JDK headers
69+
3. Add `jdk-x.x.x\include` and `jdk-x.x.x\include\win32` paths to JDK
70+
headers
6671
3. Retarget solution to the 8.1 platform version
6772
4. Build with Release configuration & x64 platform
6873

6974
The resulting files are in `..\..\bin_x64`:
70-
* `kdu_v7AR.dll`
71-
* `kdu_a7AR.dll`
75+
* `kdu_v80R.dll`
76+
* `kdu_a80R.dll`
7277
* `kdu_jni.dll`
-1.35 MB
Binary file not shown.
1.37 MB
Binary file not shown.
126 KB
Binary file not shown.
-1.03 MB
Binary file not shown.
1.28 MB
Binary file not shown.
-1.48 MB
Binary file not shown.
1.49 MB
Binary file not shown.
114 KB
Binary file not shown.
-1.42 MB
Binary file not shown.
1.76 MB
Binary file not shown.

src/main/java/kdu_jni/Ads_params.java

+4
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ public void finalize() {
1616
Native_destroy();
1717
}
1818
}
19+
private static native long Native_create();
20+
public Ads_params() {
21+
this(Native_create());
22+
}
1923
}

src/main/java/kdu_jni/Atk_params.java

+4
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@ public void finalize() {
1616
Native_destroy();
1717
}
1818
}
19+
private static native long Native_create();
20+
public Atk_params() {
21+
this(Native_create());
22+
}
1923
public native boolean Is_predef_kernel_symmetric(int _kernel_idx) throws KduException;
2024
}

src/main/java/kdu_jni/Cod_params.java

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ public void finalize() {
1616
Native_destroy();
1717
}
1818
}
19+
private static native long Native_create();
20+
public Cod_params() {
21+
this(Native_create());
22+
}
1923
public native boolean Is_valid_decomp_terminator(int _val) throws KduException;
2024
public native int Transpose_decomp(int _val) throws KduException;
2125
public native int Expand_decomp_bands(int _decomp_val, short[] _band_descriptors) throws KduException;

src/main/java/kdu_jni/Crg_params.java

+4
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ public void finalize() {
1616
Native_destroy();
1717
}
1818
}
19+
private static native long Native_create();
20+
public Crg_params() {
21+
this(Native_create());
22+
}
1923
}

src/main/java/kdu_jni/Dfs_params.java

+4
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ public void finalize() {
1616
Native_destroy();
1717
}
1818
}
19+
private static native long Native_create();
20+
public Dfs_params() {
21+
this(Native_create());
22+
}
1923
}

src/main/java/kdu_jni/Jp2_channels.java

+38-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,34 @@ public Jp2_channels() {
1616
this(0,0);
1717
}
1818
public native boolean Exists() throws KduException;
19-
public native void Copy(Jp2_channels _src) throws KduException;
20-
public native void Init(int _num_colours) throws KduException;
19+
public native void Copy(Jp2_channels _src, int[] _stream_map, int _stream_map_elts, int _stream_base) throws KduException;
20+
public void Copy(Jp2_channels _src) throws KduException
21+
{
22+
Copy(_src,null,(int) 0,(int) 0);
23+
}
24+
public void Copy(Jp2_channels _src, int[] _stream_map) throws KduException
25+
{
26+
Copy(_src,_stream_map,(int) 0,(int) 0);
27+
}
28+
public void Copy(Jp2_channels _src, int[] _stream_map, int _stream_map_elts) throws KduException
29+
{
30+
Copy(_src,_stream_map,_stream_map_elts,(int) 0);
31+
}
32+
public native void Init(int _num_colours, int _num_non_colours) throws KduException;
33+
public void Init(int _num_colours) throws KduException
34+
{
35+
Init(_num_colours,(int) 0);
36+
}
2137
public native boolean Set_colour_mapping(int _colour_idx, int _codestream_component, int _lut_idx, int _codestream_idx, int _data_format, int[] _format_params) throws KduException;
2238
public boolean Set_colour_mapping(int _colour_idx, int _codestream_component, int _lut_idx, int _codestream_idx, int _data_format) throws KduException
2339
{
2440
return Set_colour_mapping(_colour_idx,_codestream_component,_lut_idx,_codestream_idx,_data_format,null);
2541
}
42+
public native boolean Set_non_colour_mapping(int _idx, int _asoc_key, int _codestream_component, int _lut_idx, int _codestream_idx, int _data_format, int[] _format_params) throws KduException;
43+
public boolean Set_non_colour_mapping(int _idx, int _asoc_key, int _codestream_component, int _lut_idx, int _codestream_idx, int _data_format) throws KduException
44+
{
45+
return Set_non_colour_mapping(_idx,_asoc_key,_codestream_component,_lut_idx,_codestream_idx,_data_format,null);
46+
}
2647
public native boolean Set_opacity_mapping(int _colour_idx, int _codestream_component, int _lut_idx, int _codestream_idx, int _data_format, int[] _format_params) throws KduException;
2748
public boolean Set_opacity_mapping(int _colour_idx, int _codestream_component, int _lut_idx, int _codestream_idx, int _data_format) throws KduException
2849
{
@@ -35,11 +56,26 @@ public boolean Set_premult_mapping(int _colour_idx, int _codestream_component, i
3556
}
3657
public native boolean Set_chroma_key(int _colour_idx, int _key_val) throws KduException;
3758
public native int Get_num_colours() throws KduException;
59+
public native int Get_num_non_colours() throws KduException;
60+
public native int Get_codestreams_used(int[] _min_stream_idx, int[] _max_stream_idx, int[] _stream_indices, int _max_indices) throws KduException;
61+
public int Get_codestreams_used(int[] _min_stream_idx, int[] _max_stream_idx) throws KduException
62+
{
63+
return Get_codestreams_used(_min_stream_idx,_max_stream_idx,null,(int) 0);
64+
}
65+
public int Get_codestreams_used(int[] _min_stream_idx, int[] _max_stream_idx, int[] _stream_indices) throws KduException
66+
{
67+
return Get_codestreams_used(_min_stream_idx,_max_stream_idx,_stream_indices,(int) 0);
68+
}
3869
public native boolean Get_colour_mapping(int _colour_idx, int[] _codestream_component, int[] _lut_idx, int[] _codestream_idx, int[] _data_format, int[] _format_params) throws KduException;
3970
public boolean Get_colour_mapping(int _colour_idx, int[] _codestream_component, int[] _lut_idx, int[] _codestream_idx, int[] _data_format) throws KduException
4071
{
4172
return Get_colour_mapping(_colour_idx,_codestream_component,_lut_idx,_codestream_idx,_data_format,null);
4273
}
74+
public native boolean Get_non_colour_mapping(int _idx, int[] _asoc_key, int[] _codestream_component, int[] _lut_idx, int[] _codestream_idx, int[] _data_format, int[] _format_params) throws KduException;
75+
public boolean Get_non_colour_mapping(int _idx, int[] _asoc_key, int[] _codestream_component, int[] _lut_idx, int[] _codestream_idx, int[] _data_format) throws KduException
76+
{
77+
return Get_non_colour_mapping(_idx,_asoc_key,_codestream_component,_lut_idx,_codestream_idx,_data_format,null);
78+
}
4379
public native boolean Get_opacity_mapping(int _colour_idx, int[] _codestream_component, int[] _lut_idx, int[] _codestream_idx, int[] _data_format, int[] _format_params) throws KduException;
4480
public boolean Get_opacity_mapping(int _colour_idx, int[] _codestream_component, int[] _lut_idx, int[] _codestream_idx, int[] _data_format) throws KduException
4581
{

src/main/java/kdu_jni/Jp2_colour.java

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ public void Init(double[] _xy_red, double[] _xy_green, double[] _xy_blue, double
4545
{
4646
Init(_xy_red,_xy_green,_xy_blue,_gamma,_beta,_num_points,(boolean) false);
4747
}
48+
public native boolean Is_jp2_compatible() throws KduException;
49+
public native boolean Is_jph_compatible() throws KduException;
4850
public native int Get_num_colours() throws KduException;
4951
public native int Get_space() throws KduException;
5052
public native boolean Is_opponent_space() throws KduException;

src/main/java/kdu_jni/Jp2_dimensions.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ public void Init(Siz_params _siz) throws KduException
2222
Init(_siz,(boolean) true);
2323
}
2424
public native void Finalize_compatibility(Kdu_params _root) throws KduException;
25-
public native void Finalize_compatibility(int _profile, boolean _is_jpx_baseline) throws KduException;
25+
public native void Finalize_compatibility(int _profile, int _scap_val, int _extensions, int _mct_attributes, int _part2_caps) throws KduException;
2626
public native void Finalize_compatibility(Jp2_dimensions _src) throws KduException;
2727
public native boolean Set_precision(int _component_idx, int _bit_depth, boolean _is_signed) throws KduException;
2828
public boolean Set_precision(int _component_idx, int _bit_depth) throws KduException
2929
{
3030
return Set_precision(_component_idx,_bit_depth,(boolean) false);
3131
}
3232
public native void Set_ipr_box_available() throws KduException;
33+
public native boolean Is_jp2_compatible(boolean _result_if_unknown) throws KduException;
34+
public native boolean Is_jph_compatible(boolean _result_if_unknown) throws KduException;
3335
public native Kdu_coords Get_size() throws KduException;
3436
public native int Get_num_components() throws KduException;
3537
public native boolean Colour_space_known() throws KduException;

src/main/java/kdu_jni/Jp2_source.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ public void finalize() {
2020
public Jp2_source() {
2121
this(Native_create());
2222
}
23-
public native boolean Read_header() throws KduException;
23+
public native int Read_header(boolean _return_if_incompatible) throws KduException;
24+
public int Read_header() throws KduException
25+
{
26+
return Read_header((boolean) false);
27+
}
28+
public native long Get_brand() throws KduException;
2429
public native long Get_header_bytes() throws KduException;
2530
public native Jp2_dimensions Access_dimensions() throws KduException;
2631
public native Jp2_palette Access_palette() throws KduException;

src/main/java/kdu_jni/Jp2_target.java

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public void Open(Jp2_output_box _super_box, long _box_type) throws KduException
3737
Open(_super_box,_box_type,(boolean) false);
3838
}
3939
public native boolean Close_box() throws KduException;
40+
public native long Get_brand() throws KduException;
4041
public native void Write_header() throws KduException;
4142
public native void Open_codestream(boolean _rubber_length) throws KduException;
4243
public void Open_codestream() throws KduException

src/main/java/kdu_jni/Jpx_compatibility.java

+2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ public Jpx_compatibility() {
1515
}
1616
public native boolean Exists() throws KduException;
1717
public native boolean Is_jp2() throws KduException;
18+
public native long Get_brand() throws KduException;
1819
public native boolean Is_jp2_compatible() throws KduException;
20+
public native boolean Is_jph_compatible() throws KduException;
1921
public native boolean Is_jpxb_compatible() throws KduException;
2022
public native boolean Has_reader_requirements_box() throws KduException;
2123
public native boolean Check_standard_feature(int _feature_id) throws KduException;

0 commit comments

Comments
 (0)