Skip to content

Commit

Permalink
⬆️ Bump libvips to 8.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dbouron committed Jan 24, 2022
1 parent c58c71d commit 543e02a
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion script/enum-generator/EnumGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
50 changes: 50 additions & 0 deletions src/main/java/com/criteo/vips/enums/VipsFailOn.java
Original file line number Diff line number Diff line change
@@ -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<VipsFailOn, Integer>();

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;
}
}
6 changes: 4 additions & 2 deletions src/main/java/com/criteo/vips/enums/VipsForeignDzLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<VipsForeignDzLayout, Integer>();
Expand Down
50 changes: 50 additions & 0 deletions src/main/java/com/criteo/vips/enums/VipsForeignPpmFormat.java
Original file line number Diff line number Diff line change
@@ -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<VipsForeignPpmFormat, Integer>();

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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/criteo/vips/enums/VipsKernel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
14 changes: 13 additions & 1 deletion src/main/java/com/criteo/vips/enums/VipsOperationMath.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<VipsOperationMath, Integer>();
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/criteo/vips/enums/VipsOperationMath2.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<VipsOperationMath2, Integer>();
Expand Down
20 changes: 20 additions & 0 deletions src/test/c/VipsEnumTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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");
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 543e02a

Please sign in to comment.