diff --git a/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/ImageGenerator.java b/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/ImageGenerator.java index 058977242..f9b2490e0 100644 --- a/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/ImageGenerator.java +++ b/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/ImageGenerator.java @@ -38,18 +38,20 @@ public class ImageGenerator { final JSONObject cardsObject = (JSONObject) parser.parse(reader); for (Map.Entry cardEntry : (Set>) cardsObject.entrySet()) { final String cardId = cardEntry.getKey(); - BufferedImage bufferedImage = new BufferedImage(jsonImageRecipe.getWidth(), jsonImageRecipe.getHeight(), BufferedImage.TYPE_INT_RGB); - jsonImageRecipe.renderImage(properties, cardEntry.getValue(), bufferedImage); + if (cardId.equals("40_3") || cardId.equals("40_17")) { + BufferedImage bufferedImage = new BufferedImage(jsonImageRecipe.getWidth(), jsonImageRecipe.getHeight(), BufferedImage.TYPE_INT_RGB); + jsonImageRecipe.renderImage(properties, cardEntry.getValue(), bufferedImage); - JPEGImageWriteParam jpegParams = new JPEGImageWriteParam(null); - jpegParams.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); - jpegParams.setCompressionQuality(1f); + JPEGImageWriteParam jpegParams = new JPEGImageWriteParam(null); + jpegParams.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); + jpegParams.setCompressionQuality(1f); - final ImageWriter writer = ImageIO.getImageWritersByFormatName("jpg").next(); - final File resultFile = new File(output, cardId + ".jpg"); - try (FileImageOutputStream outputStream = new FileImageOutputStream(resultFile)) { - writer.setOutput(outputStream); - writer.write(null, new IIOImage(bufferedImage, null, null), jpegParams); + final ImageWriter writer = ImageIO.getImageWritersByFormatName("jpg").next(); + final File resultFile = new File(output, cardId + ".jpg"); + try (FileImageOutputStream outputStream = new FileImageOutputStream(resultFile)) { + writer.setOutput(outputStream); + writer.write(null, new IIOImage(bufferedImage, null, null), jpegParams); + } } } } catch (IOException | ParseException e) { diff --git a/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/recipe/JSONImageRecipe.java b/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/recipe/JSONImageRecipe.java index 255e3de39..bb763a23c 100644 --- a/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/recipe/JSONImageRecipe.java +++ b/gemp-lotr/gemp-lotr-images/src/main/java/com/gempukku/lotro/images/recipe/JSONImageRecipe.java @@ -525,14 +525,18 @@ public class JSONImageRecipe implements ImageRecipe { } }; Graphics2D graphics = (Graphics2D) image.getGraphics(); - graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); - graphics.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE); - graphics.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY); - graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); - graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); - for (LayerRecipe layer : layers) { - layer.renderLayer(context, graphics); + try { + graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + graphics.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE); + graphics.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY); + graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); + graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); + for (LayerRecipe layer : layers) { + layer.renderLayer(context, graphics); + } + } finally { + graphics.dispose(); } } diff --git a/gemp-lotr/gemp-lotr-images/src/main/resources/cardRecipe.json b/gemp-lotr/gemp-lotr-images/src/main/resources/cardRecipe.json index 0822b5453..1cadaaf18 100644 --- a/gemp-lotr/gemp-lotr-images/src/main/resources/cardRecipe.json +++ b/gemp-lotr/gemp-lotr-images/src/main/resources/cardRecipe.json @@ -483,7 +483,7 @@ }, "child": "LOTRSymbols.ttf" }, - "size": 40, + "size": 38, "style": 0 } }, @@ -1007,7 +1007,7 @@ "box": { "type": "box", "x": 162, - "y": 690, + "y": 692, "width": 536, "height": 265 }