diff --git a/lib/VERSIONS b/lib/VERSIONS index 46de9d35..f281687f 100644 --- a/lib/VERSIONS +++ b/lib/VERSIONS @@ -8,4 +8,4 @@ WEBP_VERSION=1.1.0 AOM_VERSION=2.0.0 HEIF_VERSION=1.9.1 LCMS2_VERSION=2.11 -VIPS_VERSION=8.11.4 +VIPS_VERSION=8.12.1 diff --git a/script/enum-generator/EnumGenerator.py b/script/enum-generator/EnumGenerator.py index 26655d2e..950da612 100644 --- a/script/enum-generator/EnumGenerator.py +++ b/script/enum-generator/EnumGenerator.py @@ -8,7 +8,7 @@ from string import Template from itertools import takewhile -DEFAULT_VIPS_VERSION = '8.11.4' +DEFAULT_VIPS_VERSION = '8.12.1' JAVA_ENUM_TEMPLATE = "template/Enum.java" C_ENUM_TEST_TEMPLATE = "template/VipsEnumTest.c" diff --git a/src/main/java/com/criteo/vips/enums/VipsFailOn.java b/src/main/java/com/criteo/vips/enums/VipsFailOn.java new file mode 100644 index 00000000..795b36c5 --- /dev/null +++ b/src/main/java/com/criteo/vips/enums/VipsFailOn.java @@ -0,0 +1,50 @@ +/* + Copyright (c) 2020 Criteo + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.criteo.vips.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum VipsFailOn { + // never stop + None(0), + // stop on image truncated, nothing else + Truncated(1), + // stop on serious error or truncation + Error(2), + // stop on anything, even warnings + Warning(3), + Last(4); + + private int value; + private static Map map = new HashMap(); + + private VipsFailOn(int i) { + value = i; + } + + static { + for (VipsFailOn e : VipsFailOn.values()) { + map.put(e.value, e); + } + } + + public static VipsFailOn valueOf(int i) { + return (VipsFailOn) map.get(i); + } + + public int getValue() { + return value; + } +} diff --git a/src/main/java/com/criteo/vips/enums/VipsForeignDzLayout.java b/src/main/java/com/criteo/vips/enums/VipsForeignDzLayout.java index fee78fad..65480944 100644 --- a/src/main/java/com/criteo/vips/enums/VipsForeignDzLayout.java +++ b/src/main/java/com/criteo/vips/enums/VipsForeignDzLayout.java @@ -23,9 +23,11 @@ public enum VipsForeignDzLayout { Zoomify(1), // use Google maps directory layout Google(2), - // use IIIF directory layout + // use IIIF v2 directory layout Iiif(3), - Last(4); + // use IIIF v3 directory layout + Iiif3(4), + Last(5); private int value; private static Map map = new HashMap(); diff --git a/src/main/java/com/criteo/vips/enums/VipsForeignPpmFormat.java b/src/main/java/com/criteo/vips/enums/VipsForeignPpmFormat.java new file mode 100644 index 00000000..45194c42 --- /dev/null +++ b/src/main/java/com/criteo/vips/enums/VipsForeignPpmFormat.java @@ -0,0 +1,50 @@ +/* + Copyright (c) 2020 Criteo + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.criteo.vips.enums; + +import java.util.HashMap; +import java.util.Map; + +public enum VipsForeignPpmFormat { + // portable bitmap + Pbm(0), + // portable greymap + Pgm(1), + // portable pixmap + Ppm(2), + // portable float map + Pfm(3), + Last(4); + + private int value; + private static Map map = new HashMap(); + + private VipsForeignPpmFormat(int i) { + value = i; + } + + static { + for (VipsForeignPpmFormat e : VipsForeignPpmFormat.values()) { + map.put(e.value, e); + } + } + + public static VipsForeignPpmFormat valueOf(int i) { + return (VipsForeignPpmFormat) map.get(i); + } + + public int getValue() { + return value; + } +} diff --git a/src/main/java/com/criteo/vips/enums/VipsForeignTiffPredictor.java b/src/main/java/com/criteo/vips/enums/VipsForeignTiffPredictor.java index fa768f88..bfa60694 100644 --- a/src/main/java/com/criteo/vips/enums/VipsForeignTiffPredictor.java +++ b/src/main/java/com/criteo/vips/enums/VipsForeignTiffPredictor.java @@ -17,8 +17,11 @@ import java.util.Map; public enum VipsForeignTiffPredictor { + // no prediction None(1), + // horizontal differencing Horizontal(2), + // float predictor Float(3), Last(4); diff --git a/src/main/java/com/criteo/vips/enums/VipsKernel.java b/src/main/java/com/criteo/vips/enums/VipsKernel.java index 4a150e00..739e9ba0 100644 --- a/src/main/java/com/criteo/vips/enums/VipsKernel.java +++ b/src/main/java/com/criteo/vips/enums/VipsKernel.java @@ -23,6 +23,7 @@ public enum VipsKernel { Linear(1), // Convolve with a cubic filter. Cubic(2), + // Convolve with a Mitchell kernel. Mitchell(3), // Convolve with a two-lobe Lanczos kernel. Lanczos2(4), diff --git a/src/main/java/com/criteo/vips/enums/VipsOperationMath.java b/src/main/java/com/criteo/vips/enums/VipsOperationMath.java index a6d17901..d988ad1c 100644 --- a/src/main/java/com/criteo/vips/enums/VipsOperationMath.java +++ b/src/main/java/com/criteo/vips/enums/VipsOperationMath.java @@ -37,7 +37,19 @@ public enum VipsOperationMath { Exp(8), // 10 to the something Exp10(9), - Last(10); + // sinh(), angles in radians + Sinh(10), + // cosh(), angles in radians + Cosh(11), + // tanh(), angles in radians + Tanh(12), + // asinh(), angles in radians + Asinh(13), + // acosh(), angles in radians + Acosh(14), + // atanh(), angles in radians + Atanh(15), + Last(16); private int value; private static Map map = new HashMap(); diff --git a/src/main/java/com/criteo/vips/enums/VipsOperationMath2.java b/src/main/java/com/criteo/vips/enums/VipsOperationMath2.java index 33043fe2..3e0ac0f6 100644 --- a/src/main/java/com/criteo/vips/enums/VipsOperationMath2.java +++ b/src/main/java/com/criteo/vips/enums/VipsOperationMath2.java @@ -21,7 +21,9 @@ public enum VipsOperationMath2 { Pow(0), // pow( right, left ) Wop(1), - Last(2); + // atan2( left, right ) + Atan2(2), + Last(3); private int value; private static Map map = new HashMap(); diff --git a/src/test/c/VipsEnumTest.c b/src/test/c/VipsEnumTest.c index 77aad078..80b7aa9b 100644 --- a/src/test/c/VipsEnumTest.c +++ b/src/test/c/VipsEnumTest.c @@ -165,6 +165,12 @@ Java_com_criteo_vips_VipsEnumTest_TestNativeEnums(JNIEnv *env, jclass c) assertEqualsNativeEnumValue(env, VIPS_EXTEND_WHITE, "com/criteo/vips/enums/VipsExtend", "White"); assertEqualsNativeEnumValue(env, VIPS_EXTEND_BACKGROUND, "com/criteo/vips/enums/VipsExtend", "Background"); assertEqualsNativeEnumValue(env, VIPS_EXTEND_LAST, "com/criteo/vips/enums/VipsExtend", "Last"); + // VipsFailOn + assertEqualsNativeEnumValue(env, VIPS_FAIL_ON_NONE, "com/criteo/vips/enums/VipsFailOn", "None"); + assertEqualsNativeEnumValue(env, VIPS_FAIL_ON_TRUNCATED, "com/criteo/vips/enums/VipsFailOn", "Truncated"); + assertEqualsNativeEnumValue(env, VIPS_FAIL_ON_ERROR, "com/criteo/vips/enums/VipsFailOn", "Error"); + assertEqualsNativeEnumValue(env, VIPS_FAIL_ON_WARNING, "com/criteo/vips/enums/VipsFailOn", "Warning"); + assertEqualsNativeEnumValue(env, VIPS_FAIL_ON_LAST, "com/criteo/vips/enums/VipsFailOn", "Last"); // VipsForeignDzContainer assertEqualsNativeEnumValue(env, VIPS_FOREIGN_DZ_CONTAINER_FS, "com/criteo/vips/enums/VipsForeignDzContainer", "Fs"); assertEqualsNativeEnumValue(env, VIPS_FOREIGN_DZ_CONTAINER_ZIP, "com/criteo/vips/enums/VipsForeignDzContainer", "Zip"); @@ -180,6 +186,7 @@ Java_com_criteo_vips_VipsEnumTest_TestNativeEnums(JNIEnv *env, jclass c) assertEqualsNativeEnumValue(env, VIPS_FOREIGN_DZ_LAYOUT_ZOOMIFY, "com/criteo/vips/enums/VipsForeignDzLayout", "Zoomify"); assertEqualsNativeEnumValue(env, VIPS_FOREIGN_DZ_LAYOUT_GOOGLE, "com/criteo/vips/enums/VipsForeignDzLayout", "Google"); assertEqualsNativeEnumValue(env, VIPS_FOREIGN_DZ_LAYOUT_IIIF, "com/criteo/vips/enums/VipsForeignDzLayout", "Iiif"); + assertEqualsNativeEnumValue(env, VIPS_FOREIGN_DZ_LAYOUT_IIIF3, "com/criteo/vips/enums/VipsForeignDzLayout", "Iiif3"); assertEqualsNativeEnumValue(env, VIPS_FOREIGN_DZ_LAYOUT_LAST, "com/criteo/vips/enums/VipsForeignDzLayout", "Last"); // VipsForeignFlags assertEqualsNativeEnumValue(env, VIPS_FOREIGN_NONE, "com/criteo/vips/enums/VipsForeignFlags", "None"); @@ -205,6 +212,12 @@ Java_com_criteo_vips_VipsEnumTest_TestNativeEnums(JNIEnv *env, jclass c) assertEqualsNativeEnumValue(env, VIPS_FOREIGN_PNG_FILTER_AVG, "com/criteo/vips/enums/VipsForeignPngFilter", "Avg"); assertEqualsNativeEnumValue(env, VIPS_FOREIGN_PNG_FILTER_PAETH, "com/criteo/vips/enums/VipsForeignPngFilter", "Paeth"); assertEqualsNativeEnumValue(env, VIPS_FOREIGN_PNG_FILTER_ALL, "com/criteo/vips/enums/VipsForeignPngFilter", "All"); + // VipsForeignPpmFormat + assertEqualsNativeEnumValue(env, VIPS_FOREIGN_PPM_FORMAT_PBM, "com/criteo/vips/enums/VipsForeignPpmFormat", "Pbm"); + assertEqualsNativeEnumValue(env, VIPS_FOREIGN_PPM_FORMAT_PGM, "com/criteo/vips/enums/VipsForeignPpmFormat", "Pgm"); + assertEqualsNativeEnumValue(env, VIPS_FOREIGN_PPM_FORMAT_PPM, "com/criteo/vips/enums/VipsForeignPpmFormat", "Ppm"); + assertEqualsNativeEnumValue(env, VIPS_FOREIGN_PPM_FORMAT_PFM, "com/criteo/vips/enums/VipsForeignPpmFormat", "Pfm"); + assertEqualsNativeEnumValue(env, VIPS_FOREIGN_PPM_FORMAT_LAST, "com/criteo/vips/enums/VipsForeignPpmFormat", "Last"); // VipsForeignSubsample assertEqualsNativeEnumValue(env, VIPS_FOREIGN_SUBSAMPLE_AUTO, "com/criteo/vips/enums/VipsForeignSubsample", "Auto"); assertEqualsNativeEnumValue(env, VIPS_FOREIGN_SUBSAMPLE_ON, "com/criteo/vips/enums/VipsForeignSubsample", "On"); @@ -329,10 +342,17 @@ Java_com_criteo_vips_VipsEnumTest_TestNativeEnums(JNIEnv *env, jclass c) assertEqualsNativeEnumValue(env, VIPS_OPERATION_MATH_LOG10, "com/criteo/vips/enums/VipsOperationMath", "Log10"); assertEqualsNativeEnumValue(env, VIPS_OPERATION_MATH_EXP, "com/criteo/vips/enums/VipsOperationMath", "Exp"); assertEqualsNativeEnumValue(env, VIPS_OPERATION_MATH_EXP10, "com/criteo/vips/enums/VipsOperationMath", "Exp10"); + assertEqualsNativeEnumValue(env, VIPS_OPERATION_MATH_SINH, "com/criteo/vips/enums/VipsOperationMath", "Sinh"); + assertEqualsNativeEnumValue(env, VIPS_OPERATION_MATH_COSH, "com/criteo/vips/enums/VipsOperationMath", "Cosh"); + assertEqualsNativeEnumValue(env, VIPS_OPERATION_MATH_TANH, "com/criteo/vips/enums/VipsOperationMath", "Tanh"); + assertEqualsNativeEnumValue(env, VIPS_OPERATION_MATH_ASINH, "com/criteo/vips/enums/VipsOperationMath", "Asinh"); + assertEqualsNativeEnumValue(env, VIPS_OPERATION_MATH_ACOSH, "com/criteo/vips/enums/VipsOperationMath", "Acosh"); + assertEqualsNativeEnumValue(env, VIPS_OPERATION_MATH_ATANH, "com/criteo/vips/enums/VipsOperationMath", "Atanh"); assertEqualsNativeEnumValue(env, VIPS_OPERATION_MATH_LAST, "com/criteo/vips/enums/VipsOperationMath", "Last"); // VipsOperationMath2 assertEqualsNativeEnumValue(env, VIPS_OPERATION_MATH2_POW, "com/criteo/vips/enums/VipsOperationMath2", "Pow"); assertEqualsNativeEnumValue(env, VIPS_OPERATION_MATH2_WOP, "com/criteo/vips/enums/VipsOperationMath2", "Wop"); + assertEqualsNativeEnumValue(env, VIPS_OPERATION_MATH2_ATAN2, "com/criteo/vips/enums/VipsOperationMath2", "Atan2"); assertEqualsNativeEnumValue(env, VIPS_OPERATION_MATH2_LAST, "com/criteo/vips/enums/VipsOperationMath2", "Last"); // VipsOperationMorphology assertEqualsNativeEnumValue(env, VIPS_OPERATION_MORPHOLOGY_ERODE, "com/criteo/vips/enums/VipsOperationMorphology", "Erode");