diff --git a/org.eclipse.tm4e.language_pack/syntaxes/git-base/icon.png b/org.eclipse.tm4e.language_pack/syntaxes/git-base/icon.png index 89e0ae9f8..32eb03f1e 100644 Binary files a/org.eclipse.tm4e.language_pack/syntaxes/git-base/icon.png and b/org.eclipse.tm4e.language_pack/syntaxes/git-base/icon.png differ diff --git a/org.eclipse.tm4e.language_pack/syntaxes/git-base/icon@2x.png b/org.eclipse.tm4e.language_pack/syntaxes/git-base/icon@2x.png index 615cf5b7d..9d257e378 100644 Binary files a/org.eclipse.tm4e.language_pack/syntaxes/git-base/icon@2x.png and b/org.eclipse.tm4e.language_pack/syntaxes/git-base/icon@2x.png differ diff --git a/org.eclipse.tm4e.language_pack/syntaxes/markdown-math/icon.png b/org.eclipse.tm4e.language_pack/syntaxes/markdown-math/icon.png index 7ff53b97b..e63a40090 100644 Binary files a/org.eclipse.tm4e.language_pack/syntaxes/markdown-math/icon.png and b/org.eclipse.tm4e.language_pack/syntaxes/markdown-math/icon.png differ diff --git a/org.eclipse.tm4e.language_pack/syntaxes/markdown-math/icon@2x.png b/org.eclipse.tm4e.language_pack/syntaxes/markdown-math/icon@2x.png index 18d3e088c..883566ccc 100644 Binary files a/org.eclipse.tm4e.language_pack/syntaxes/markdown-math/icon@2x.png and b/org.eclipse.tm4e.language_pack/syntaxes/markdown-math/icon@2x.png differ diff --git a/org.eclipse.tm4e.language_pack/syntaxes/search-result/icon.png b/org.eclipse.tm4e.language_pack/syntaxes/search-result/icon.png index e433c5f4f..d9b0e1db4 100644 Binary files a/org.eclipse.tm4e.language_pack/syntaxes/search-result/icon.png and b/org.eclipse.tm4e.language_pack/syntaxes/search-result/icon.png differ diff --git a/org.eclipse.tm4e.language_pack/syntaxes/search-result/icon@2x.png b/org.eclipse.tm4e.language_pack/syntaxes/search-result/icon@2x.png index d1567b906..a1cbe7ba5 100644 Binary files a/org.eclipse.tm4e.language_pack/syntaxes/search-result/icon@2x.png and b/org.eclipse.tm4e.language_pack/syntaxes/search-result/icon@2x.png differ diff --git a/org.eclipse.tm4e.language_pack/updater/pom.xml b/org.eclipse.tm4e.language_pack/updater/pom.xml index 1c501f00d..8eb15a9c3 100644 --- a/org.eclipse.tm4e.language_pack/updater/pom.xml +++ b/org.eclipse.tm4e.language_pack/updater/pom.xml @@ -59,11 +59,5 @@ - - - net.coobird - thumbnailator - 0.4.20 - \ No newline at end of file diff --git a/org.eclipse.tm4e.language_pack/updater/src/main/java/updater/VSCodeSingleExtensionSourceHandler.java b/org.eclipse.tm4e.language_pack/updater/src/main/java/updater/VSCodeSingleExtensionSourceHandler.java index 08d440953..f6bd91cd1 100644 --- a/org.eclipse.tm4e.language_pack/updater/src/main/java/updater/VSCodeSingleExtensionSourceHandler.java +++ b/org.eclipse.tm4e.language_pack/updater/src/main/java/updater/VSCodeSingleExtensionSourceHandler.java @@ -17,7 +17,6 @@ import java.awt.Graphics2D; import java.awt.RenderingHints; -import java.awt.Transparency; import java.awt.image.BufferedImage; import java.io.IOException; import java.nio.file.Files; @@ -28,7 +27,6 @@ import javax.imageio.ImageIO; -import net.coobird.thumbnailator.Thumbnails; import updater.Updater.Config; import updater.Updater.State.ExtensionState; import updater.Updater.State.LanguageState; @@ -107,8 +105,8 @@ void handle() throws IOException { final var targetIcon = targetSyntaxDir.resolve("icon.png"); logInfo("Copying file [icon.png]..."); final var sourceIcon = ImageIO.read(sourceExtensionDir.resolve(pkgJson.icon()).toFile()); - Thumbnails.of(sourceIcon).size(16, 16).outputFormat("png").toFile(targetIcon.toFile()); - Thumbnails.of(sourceIcon).size(32, 32).outputFormat("png").toFile(targetSyntaxDir.resolve("icon@2x.png").toFile()); + ImageIO.write(resizeImage(sourceIcon, 16, 16), "png", targetIcon.toFile()); + ImageIO.write(resizeImage(sourceIcon, 32, 32), "png", targetSyntaxDir.resolve("icon@2x.png").toFile()); } for (final Entry lang : pkgJsonLangs.entrySet()) { @@ -149,9 +147,8 @@ void handle() throws IOException { logInfo("Copying image [" + langCfg.icon().light() + "] -> [" + targetIcon.getFileName() + "]...", false); try { final var sourceIcon = ImageIO.read(sourceExtensionDir.resolve(langCfg.icon().light()).toFile()); - Thumbnails.of(sourceIcon).size(16, 16).outputFormat("png").toFile(targetIcon.toFile()); - Thumbnails.of(sourceIcon).size(32, 32).outputFormat("png") - .toFile(ctx.targetDir().resolve(langId + "@2x.png").toFile()); + ImageIO.write(resizeImage(sourceIcon, 16, 16), "png", targetIcon.toFile()); + ImageIO.write(resizeImage(sourceIcon, 32, 32), "png", ctx.targetDir().resolve(langId + "@2x.png").toFile()); logInfo(" OK", true, false); } catch (final Exception ex) { logInfo(" ERROR [" + ex.getMessage().replace("\n", " | ") + "]", true, false); @@ -184,8 +181,8 @@ void handle() throws IOException { final var grammarOverrides = defaultIfNull(source.inlineGrammars.get(scopeName), Config.InlineGrammarIgnoreable::new); if (!isBlank(grammarOverrides.ignoredReason) && !"false".equals(grammarOverrides.ignoredReason)) { - logInfo("Ignoring inline grammar contribution [" + scopeName + "] as per user config" + ("true".equals( - grammarOverrides.ignoredReason) ? "." : ": " + grammarOverrides.ignoredReason)); + logInfo("Ignoring inline grammar contribution [" + scopeName + "] as per user config" + + ("true".equals(grammarOverrides.ignoredReason) ? "." : ": " + grammarOverrides.ignoredReason)); continue; } final var grammarCfg = inlineGrammar.getValue(); @@ -197,10 +194,10 @@ void handle() throws IOException { } BufferedImage resizeImage(final BufferedImage originalImage, final int targetWidth, final int targetHeight) { - final BufferedImage resizedImage = new BufferedImage(targetWidth, targetHeight, Transparency.TRANSLUCENT); + final var resizedImage = new BufferedImage(targetWidth, targetHeight, BufferedImage.TYPE_INT_ARGB); final Graphics2D g2d = resizedImage.createGraphics(); - // Use RenderingHints to improve image quality + // use RenderingHints to improve image quality g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); g2d.drawImage(originalImage, 0, 0, targetWidth, targetHeight, null); g2d.dispose();