From 4aa9e13abd2a6a5d92f909ad614a113acadb975d Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Tue, 29 Sep 2020 23:14:58 +0200 Subject: [PATCH] Fixed empty image for bug reading in Java. --- .../catgenerator/cli/CatGeneratorCLI.java | 2 +- .../catgenerator/core/BirdGenerator.java | 5 +++-- .../core/images/bird/accessorie_13.png | Bin 298 -> 187 bytes .../core/images/bird/accessorie_17.png | Bin 298 -> 187 bytes .../core/images/bird/accessorie_18.png | Bin 298 -> 187 bytes .../core/images/bird/accessorie_19.png | Bin 298 -> 187 bytes .../core/images/bird/accessorie_2.png | Bin 298 -> 187 bytes .../core/images/bird/accessorie_20.png | Bin 298 -> 187 bytes .../core/images/bird/accessorie_4.png | Bin 298 -> 187 bytes .../catgenerator/core/images/bird/hoop_8.png | Bin 298 -> 187 bytes 10 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fr/devinsy/catgenerator/cli/CatGeneratorCLI.java b/src/fr/devinsy/catgenerator/cli/CatGeneratorCLI.java index 826acc7..0231071 100644 --- a/src/fr/devinsy/catgenerator/cli/CatGeneratorCLI.java +++ b/src/fr/devinsy/catgenerator/cli/CatGeneratorCLI.java @@ -261,7 +261,7 @@ public final class CatGeneratorCLI catch (IOException exception) { logger.error("Error detected: {}", exception.getMessage()); - // exception.printStackTrace(); + exception.printStackTrace(); } // diff --git a/src/fr/devinsy/catgenerator/core/BirdGenerator.java b/src/fr/devinsy/catgenerator/core/BirdGenerator.java index fd59668..56c25ce 100644 --- a/src/fr/devinsy/catgenerator/core/BirdGenerator.java +++ b/src/fr/devinsy/catgenerator/core/BirdGenerator.java @@ -149,7 +149,7 @@ public class BirdGenerator drawImage(grapher, "hoop", generator.nextInt(10) + 1); drawImage(grapher, "body", generator.nextInt(9) + 1); drawImage(grapher, "wing", generator.nextInt(9) + 1); - drawImage(grapher, "eye", generator.nextInt(9) + 1); + drawImage(grapher, "eyes", generator.nextInt(9) + 1); drawImage(grapher, "bec", generator.nextInt(9) + 1); drawImage(grapher, "accessorie", generator.nextInt(20) + 1); @@ -266,7 +266,8 @@ public class BirdGenerator */ private static void drawImage(final Graphics2D grapher, final String name, final int index) throws IOException { - URL url = BirdGenerator.class.getResource("/fr/devinsy/catgenerator/core/images/bird/" + name + "_" + index + ".png"); + String fileName = "/fr/devinsy/catgenerator/core/images/bird/" + name + "_" + index + ".png"; + URL url = BirdGenerator.class.getResource(fileName); BufferedImage part = ImageIO.read(url); grapher.drawImage(part, null, 0, 0); } diff --git a/src/fr/devinsy/catgenerator/core/images/bird/accessorie_13.png b/src/fr/devinsy/catgenerator/core/images/bird/accessorie_13.png index 18d2ae71d824f72c3eb6ae9ee9d476a2b02c8b3e..764d24fed082862bd5b59618bee8711aa7a64364 100644 GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^ZXnFT1|$ph9<=}|&H|6fVg?3oVGw3ym^DWND46T% z;uum9_x6GzBanA!!B_uWj`$9T!~+eC%xpXo1_{(-G^Qu`Tw`Fg-7KUAw2Hyg)z4*} HQ$iB}r1dL5 delta 262 zcmdnZxQc0lL?R;t5JZOF*91~5>5jgR3=A9lx&I`x0{IHb9znhg3{`3j3=J&|48MRv z4KElNN(~qoUL`OvSj}Ky5HFasE6@fg!Bi6D7tFv=Huy#!MZphgNcD@4+CTFB-s+6lxm4wK6o&HZZa>FbH41{UVBn-29Zxv`VN3GhHLo f5F=wNLn#w0BTI;m`sRJTKphO8u6{1-oD!M5jgR3=A9lx&I`x0{IHb9znhg3{`3j3=J&|48MRv z4KElNN(~qoUL`OvSj}Ky5HFasE6@fg!Bi6D7tFv=Huy#!MZphgNcD@4+CTFB-s+6lxm4wK6o&HZZa>FbH41{UVBn-29Zxv`VN3GhHLo f5F=wNLn#w0BTI;m`sRJTKphO8u6{1-oD!M5jgR3=A9lx&I`x0{IHb9znhg3{`3j3=J&|48MRv z4KElNN(~qoUL`OvSj}Ky5HFasE6@fg!Bi6D7tFv=Huy#!MZphgNcD@4+CTFB-s+6l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