Update recadrage

This commit is contained in:
Louis Calas 2019-10-10 11:52:53 +02:00
parent 71e626c054
commit a7223aa99b
2 changed files with 20 additions and 8 deletions

View File

@ -83,14 +83,20 @@ public class Recadrage {
public BufferedImage[] listAutomation(BufferedImage[] list){
BufferedImage[] retour=new BufferedImage[list.length];
int i=0;
for (BufferedImage imag:list)
public ArrayList<BufferedImage> listAutomation(ArrayList<BufferedImage>list){
ArrayList<BufferedImage> retour =new ArrayList<BufferedImage>();
for (BufferedImage imag:list) {
this.img=imag;
this.automation();
retour[i]=this.img;
i++;
try {
this.automation();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
retour.add(this.img);
}
return retour;
}

View File

@ -17,6 +17,8 @@ import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.rendering.ImageType;
import org.apache.pdfbox.rendering.PDFRenderer;
import lecturePdf.Recadrage;
public class PdfToImage {
public List<String> listAllFiles(String directory, String extension) {
@ -31,6 +33,7 @@ public class PdfToImage {
return files;
}
public BufferedImage blackWhiteConvert(BufferedImage image) {
// Convertit une image en image en noir et blanc
// TODO : voir recursivite
@ -86,7 +89,10 @@ public class PdfToImage {
} catch (IOException ioe) {
ioe.printStackTrace();
}
return images;
Recadrage recadrage=new Recadrage();
return recadrage.listAutomation(images);
//return images;
}
public void saveOnDisk(List<BufferedImage> images, String originalFileDir) {