From 8f6e2cb385f0646b7e3dd3bbab0ab9f441ce3205 Mon Sep 17 00:00:00 2001 From: Louis Calas Date: Thu, 10 Oct 2019 21:04:45 +0200 Subject: [PATCH] Bug fix --- src/Exec.java | 2 +- src/commands/Read.java | 1 - src/ocr/GestionnaireCopies.java | 3 ++- src/ocr/PdfToImage.java | 3 --- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Exec.java b/src/Exec.java index 3fc8aa6..07c5f54 100644 --- a/src/Exec.java +++ b/src/Exec.java @@ -1,5 +1,5 @@ - import java.util.concurrent.Callable; +import java.util.concurrent.Callable; import commands.Analyse; import commands.Build; diff --git a/src/commands/Read.java b/src/commands/Read.java index 6245616..d0e5709 100644 --- a/src/commands/Read.java +++ b/src/commands/Read.java @@ -145,7 +145,6 @@ public class Read implements Callable { } - Config config = new Config(source_path); //Initialise le fichier de configuration selon le chemin donné config.readConfig(); diff --git a/src/ocr/GestionnaireCopies.java b/src/ocr/GestionnaireCopies.java index 15a5cff..bae2838 100644 --- a/src/ocr/GestionnaireCopies.java +++ b/src/ocr/GestionnaireCopies.java @@ -13,7 +13,7 @@ import java.util.Map; import org.apache.pdfbox.pdmodel.PDDocument; - + public class GestionnaireCopies { private List listeCopie; @@ -56,6 +56,7 @@ public class GestionnaireCopies { images.addAll(pdfAnalyzer.convertPagesToBWJPG(document,1)); // appelle la methode qui convertit les pages en images (jpg) noir et blanches + document.close(); } } catch (IOException e) { diff --git a/src/ocr/PdfToImage.java b/src/ocr/PdfToImage.java index ad08b33..f95acea 100644 --- a/src/ocr/PdfToImage.java +++ b/src/ocr/PdfToImage.java @@ -1,6 +1,5 @@ package ocr; import java.awt.image.BufferedImage; -import java.util.logging.Logger; import java.io.File; import java.io.IOException; import java.nio.file.Files; @@ -21,8 +20,6 @@ import org.apache.pdfbox.rendering.PDFRenderer; import lecturePdf.Recadrage; public class PdfToImage { - - //Logger.getLogger("org.apache.pdfbox").setLevel(java.util.logging.Level.OFF); public List listAllFiles(String directory, String extension) { // https://www.mkyong.com/java/java-how-to-list-all-files-in-a-directory/