From 3f821a902d21a22dd6cdd9a02a6c2c1060f396f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20L=C3=B6nnqvist?= Date: Fri, 8 Jan 2021 23:45:30 +0200 Subject: [PATCH] added option webp-l to use lossless webp #3191 --- DynmapCore/src/main/java/org/dynmap/MapType.java | 3 ++- DynmapCore/src/main/java/org/dynmap/utils/ImageIOManager.java | 2 +- fabric-1.16.1/src/main/resources/configuration.txt | 2 +- fabric-1.16.2/src/main/resources/configuration.txt | 2 +- fabric-1.16.4/src/main/resources/configuration.txt | 2 +- forge-1.11.2/src/main/resources/configuration.txt | 2 +- forge-1.12.2/src/main/resources/configuration.txt | 2 +- forge-1.13.2/src/main/resources/configuration.txt | 2 +- forge-1.14.4/src/main/resources/configuration.txt | 2 +- forge-1.15.2/src/main/resources/configuration.txt | 2 +- forge-1.16.1/src/main/resources/configuration.txt | 2 +- forge-1.16.2/src/main/resources/configuration.txt | 2 +- forge-1.16.3/src/main/resources/configuration.txt | 2 +- spigot/src/main/resources/configuration.txt | 2 +- 14 files changed, 15 insertions(+), 14 deletions(-) diff --git a/DynmapCore/src/main/java/org/dynmap/MapType.java b/DynmapCore/src/main/java/org/dynmap/MapType.java index aada3863..bd0724c9 100644 --- a/DynmapCore/src/main/java/org/dynmap/MapType.java +++ b/DynmapCore/src/main/java/org/dynmap/MapType.java @@ -73,7 +73,8 @@ public abstract class MapType { FORMAT_WEBP("webp", 85, ImageEncoding.WEBP), FORMAT_WEBP90("webp-q90", 90, ImageEncoding.WEBP), FORMAT_WEBP95("webp-q95", 95, ImageEncoding.WEBP), - FORMAT_WEBP100("webp-q100", 100, ImageEncoding.WEBP); + FORMAT_WEBP100("webp-q100", 100, ImageEncoding.WEBP), + FORMAT_WEBPL("webp-l", 85, ImageEncoding.WEBP); String id; float qual; ImageEncoding enc; diff --git a/DynmapCore/src/main/java/org/dynmap/utils/ImageIOManager.java b/DynmapCore/src/main/java/org/dynmap/utils/ImageIOManager.java index 8e7dd86f..3d57cd69 100644 --- a/DynmapCore/src/main/java/org/dynmap/utils/ImageIOManager.java +++ b/DynmapCore/src/main/java/org/dynmap/utils/ImageIOManager.java @@ -59,7 +59,7 @@ public class ImageIOManager { fos.close(); // Run encoder to new new temp file File tmpfile2 = File.createTempFile("pngToWebp", "webp"); - String args[] = { core.getCWEBPPath(), "-q", Integer.toString((int)fmt.getQuality()), tmpfile.getAbsolutePath(), "-o", tmpfile2.getAbsolutePath() }; + String args[] = { core.getCWEBPPath(), fmt.getID().endsWith("-l")?"-lossless":"", "-q", Integer.toString((int)fmt.getQuality()), tmpfile.getAbsolutePath(), "-o", tmpfile2.getAbsolutePath() }; Process pr = Runtime.getRuntime().exec(args); try { pr.waitFor(); diff --git a/fabric-1.16.1/src/main/resources/configuration.txt b/fabric-1.16.1/src/main/resources/configuration.txt index 579197f5..b01fc80d 100644 --- a/fabric-1.16.1/src/main/resources/configuration.txt +++ b/fabric-1.16.1/src/main/resources/configuration.txt @@ -254,7 +254,7 @@ block-alias: # "minecraft:quartz_ore": "stone" # "diamond_ore": "coal_ore" -# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100), +# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100, wepb-l), # Note: any webp format requires the presence of the 'webp command line tools' (cwebp, dwebp) (https://developers.google.com/speed/webp/download) # # Has no effect on maps with explicit format settings diff --git a/fabric-1.16.2/src/main/resources/configuration.txt b/fabric-1.16.2/src/main/resources/configuration.txt index 579197f5..b01fc80d 100644 --- a/fabric-1.16.2/src/main/resources/configuration.txt +++ b/fabric-1.16.2/src/main/resources/configuration.txt @@ -254,7 +254,7 @@ block-alias: # "minecraft:quartz_ore": "stone" # "diamond_ore": "coal_ore" -# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100), +# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100, wepb-l), # Note: any webp format requires the presence of the 'webp command line tools' (cwebp, dwebp) (https://developers.google.com/speed/webp/download) # # Has no effect on maps with explicit format settings diff --git a/fabric-1.16.4/src/main/resources/configuration.txt b/fabric-1.16.4/src/main/resources/configuration.txt index 579197f5..b01fc80d 100644 --- a/fabric-1.16.4/src/main/resources/configuration.txt +++ b/fabric-1.16.4/src/main/resources/configuration.txt @@ -254,7 +254,7 @@ block-alias: # "minecraft:quartz_ore": "stone" # "diamond_ore": "coal_ore" -# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100), +# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100, wepb-l), # Note: any webp format requires the presence of the 'webp command line tools' (cwebp, dwebp) (https://developers.google.com/speed/webp/download) # # Has no effect on maps with explicit format settings diff --git a/forge-1.11.2/src/main/resources/configuration.txt b/forge-1.11.2/src/main/resources/configuration.txt index 579197f5..b01fc80d 100644 --- a/forge-1.11.2/src/main/resources/configuration.txt +++ b/forge-1.11.2/src/main/resources/configuration.txt @@ -254,7 +254,7 @@ block-alias: # "minecraft:quartz_ore": "stone" # "diamond_ore": "coal_ore" -# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100), +# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100, wepb-l), # Note: any webp format requires the presence of the 'webp command line tools' (cwebp, dwebp) (https://developers.google.com/speed/webp/download) # # Has no effect on maps with explicit format settings diff --git a/forge-1.12.2/src/main/resources/configuration.txt b/forge-1.12.2/src/main/resources/configuration.txt index 579197f5..b01fc80d 100644 --- a/forge-1.12.2/src/main/resources/configuration.txt +++ b/forge-1.12.2/src/main/resources/configuration.txt @@ -254,7 +254,7 @@ block-alias: # "minecraft:quartz_ore": "stone" # "diamond_ore": "coal_ore" -# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100), +# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100, wepb-l), # Note: any webp format requires the presence of the 'webp command line tools' (cwebp, dwebp) (https://developers.google.com/speed/webp/download) # # Has no effect on maps with explicit format settings diff --git a/forge-1.13.2/src/main/resources/configuration.txt b/forge-1.13.2/src/main/resources/configuration.txt index 579197f5..b01fc80d 100644 --- a/forge-1.13.2/src/main/resources/configuration.txt +++ b/forge-1.13.2/src/main/resources/configuration.txt @@ -254,7 +254,7 @@ block-alias: # "minecraft:quartz_ore": "stone" # "diamond_ore": "coal_ore" -# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100), +# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100, wepb-l), # Note: any webp format requires the presence of the 'webp command line tools' (cwebp, dwebp) (https://developers.google.com/speed/webp/download) # # Has no effect on maps with explicit format settings diff --git a/forge-1.14.4/src/main/resources/configuration.txt b/forge-1.14.4/src/main/resources/configuration.txt index 579197f5..b01fc80d 100644 --- a/forge-1.14.4/src/main/resources/configuration.txt +++ b/forge-1.14.4/src/main/resources/configuration.txt @@ -254,7 +254,7 @@ block-alias: # "minecraft:quartz_ore": "stone" # "diamond_ore": "coal_ore" -# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100), +# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100, wepb-l), # Note: any webp format requires the presence of the 'webp command line tools' (cwebp, dwebp) (https://developers.google.com/speed/webp/download) # # Has no effect on maps with explicit format settings diff --git a/forge-1.15.2/src/main/resources/configuration.txt b/forge-1.15.2/src/main/resources/configuration.txt index 579197f5..b01fc80d 100644 --- a/forge-1.15.2/src/main/resources/configuration.txt +++ b/forge-1.15.2/src/main/resources/configuration.txt @@ -254,7 +254,7 @@ block-alias: # "minecraft:quartz_ore": "stone" # "diamond_ore": "coal_ore" -# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100), +# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100, wepb-l), # Note: any webp format requires the presence of the 'webp command line tools' (cwebp, dwebp) (https://developers.google.com/speed/webp/download) # # Has no effect on maps with explicit format settings diff --git a/forge-1.16.1/src/main/resources/configuration.txt b/forge-1.16.1/src/main/resources/configuration.txt index 579197f5..b01fc80d 100644 --- a/forge-1.16.1/src/main/resources/configuration.txt +++ b/forge-1.16.1/src/main/resources/configuration.txt @@ -254,7 +254,7 @@ block-alias: # "minecraft:quartz_ore": "stone" # "diamond_ore": "coal_ore" -# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100), +# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100, wepb-l), # Note: any webp format requires the presence of the 'webp command line tools' (cwebp, dwebp) (https://developers.google.com/speed/webp/download) # # Has no effect on maps with explicit format settings diff --git a/forge-1.16.2/src/main/resources/configuration.txt b/forge-1.16.2/src/main/resources/configuration.txt index 579197f5..b01fc80d 100644 --- a/forge-1.16.2/src/main/resources/configuration.txt +++ b/forge-1.16.2/src/main/resources/configuration.txt @@ -254,7 +254,7 @@ block-alias: # "minecraft:quartz_ore": "stone" # "diamond_ore": "coal_ore" -# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100), +# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100, wepb-l), # Note: any webp format requires the presence of the 'webp command line tools' (cwebp, dwebp) (https://developers.google.com/speed/webp/download) # # Has no effect on maps with explicit format settings diff --git a/forge-1.16.3/src/main/resources/configuration.txt b/forge-1.16.3/src/main/resources/configuration.txt index 579197f5..b01fc80d 100644 --- a/forge-1.16.3/src/main/resources/configuration.txt +++ b/forge-1.16.3/src/main/resources/configuration.txt @@ -254,7 +254,7 @@ block-alias: # "minecraft:quartz_ore": "stone" # "diamond_ore": "coal_ore" -# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100), +# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100, wepb-l), # Note: any webp format requires the presence of the 'webp command line tools' (cwebp, dwebp) (https://developers.google.com/speed/webp/download) # # Has no effect on maps with explicit format settings diff --git a/spigot/src/main/resources/configuration.txt b/spigot/src/main/resources/configuration.txt index e7cd835e..4ec83e78 100644 --- a/spigot/src/main/resources/configuration.txt +++ b/spigot/src/main/resources/configuration.txt @@ -255,7 +255,7 @@ block-alias: # "minecraft:quartz_ore": "stone" # "diamond_ore": "coal_ore" -# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100), +# Default image format for HDMaps (png, jpg, jpg-q75, jpg-q80, jpg-q85, jpg-q90, jpg-q95, jpg-q100, webp, webp-q75, webp-q80, webp-q85, webp-q90, webp-q95, webp-q100, wepb-l), # Note: any webp format requires the presence of the 'webp command line tools' (cwebp, dwebp) (https://developers.google.com/speed/webp/download) # # Has no effect on maps with explicit format settings