Update recadrage
This commit is contained in:
parent
71e626c054
commit
a7223aa99b
@ -83,14 +83,20 @@ public class Recadrage {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public BufferedImage[] listAutomation(BufferedImage[] list){
|
public ArrayList<BufferedImage> listAutomation(ArrayList<BufferedImage>list){
|
||||||
BufferedImage[] retour=new BufferedImage[list.length];
|
ArrayList<BufferedImage> retour =new ArrayList<BufferedImage>();
|
||||||
int i=0;
|
|
||||||
for (BufferedImage imag:list)
|
for (BufferedImage imag:list) {
|
||||||
this.img=imag;
|
this.img=imag;
|
||||||
|
try {
|
||||||
this.automation();
|
this.automation();
|
||||||
retour[i]=this.img;
|
} catch (IOException e) {
|
||||||
i++;
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
retour.add(this.img);
|
||||||
|
}
|
||||||
|
return retour;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,6 +17,8 @@ import org.apache.pdfbox.pdmodel.PDPage;
|
|||||||
import org.apache.pdfbox.rendering.ImageType;
|
import org.apache.pdfbox.rendering.ImageType;
|
||||||
import org.apache.pdfbox.rendering.PDFRenderer;
|
import org.apache.pdfbox.rendering.PDFRenderer;
|
||||||
|
|
||||||
|
import lecturePdf.Recadrage;
|
||||||
|
|
||||||
public class PdfToImage {
|
public class PdfToImage {
|
||||||
|
|
||||||
public List<String> listAllFiles(String directory, String extension) {
|
public List<String> listAllFiles(String directory, String extension) {
|
||||||
@ -31,6 +33,7 @@ public class PdfToImage {
|
|||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public BufferedImage blackWhiteConvert(BufferedImage image) {
|
public BufferedImage blackWhiteConvert(BufferedImage image) {
|
||||||
// Convertit une image en image en noir et blanc
|
// Convertit une image en image en noir et blanc
|
||||||
// TODO : voir recursivite
|
// TODO : voir recursivite
|
||||||
@ -86,7 +89,10 @@ public class PdfToImage {
|
|||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
ioe.printStackTrace();
|
ioe.printStackTrace();
|
||||||
}
|
}
|
||||||
return images;
|
Recadrage recadrage=new Recadrage();
|
||||||
|
return recadrage.listAutomation(images);
|
||||||
|
//return images;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveOnDisk(List<BufferedImage> images, String originalFileDir) {
|
public void saveOnDisk(List<BufferedImage> images, String originalFileDir) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user