Fixed multiple issues with the layout

This commit is contained in:
marcin.sciesinski
2019-10-12 08:22:00 -07:00
parent 7c7edbfb4c
commit 3a59802f1c
3 changed files with 15 additions and 17 deletions

View File

@@ -38,20 +38,18 @@ public class ImageGenerator {
final JSONObject cardsObject = (JSONObject) parser.parse(reader);
for (Map.Entry<String, JSONObject> cardEntry : (Set<Map.Entry<String, JSONObject>>) cardsObject.entrySet()) {
final String cardId = cardEntry.getKey();
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);
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) {

View File

@@ -714,7 +714,7 @@
"box": {
"type": "box",
"x": 45,
"y": 685,
"y": 681,
"width": 90,
"height": 50,
"horAlign": "center"
@@ -1003,12 +1003,12 @@
"shire": "#",
"dwarven": "@"
},
"minYStart": 0.15,
"minYStart": 0.10,
"box": {
"type": "box",
"x": 160,
"x": 162,
"y": 690,
"width": 540,
"width": 536,
"height": 265
}
}

View File

@@ -12,7 +12,7 @@ subtitle.size=35
type.font=fonts/o_wap_matbolsmallcap.ttf
type.size=35
numbers.font=Joe-resources/GaramondBE-Medium.otf
numbers.size=60
numbers.size=58
#text.font=Joe-resources/LOTR.ttf
text.font=fonts/o_lotrrg__.ttf
text.size=27