1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
public void resizeFolder() throws IOException, IM4JavaException, InfoException, InterruptedException {
ConvertCmd cmd = new ConvertCmd();
IMOperation op = new IMOperation();
//r�cup�ration des noms de fichiers
List<String> files = this.getFilesList(this.getUploadPath());
System.out.println(this.getUploadPath());
System.out.println("nombre de fichiers==" + files.size());
// cr�er la forme de noms des fichiers r�sultats
FilenamePatternResolver resolver = new FilenamePatternResolver(this.getResizedPath() + "%f." + this.getResizedExtension());
// boucle for pour convertir tous les fichiers
for (String imageSource : files) {
System.out.println(imageSource);
// op = this.getImOperations("portrait");
if (this.isItlandScape(imageSource)) {
op = this.getImOperations("landscape");
} else {
op = this.getImOperations("portrait");
}
/* ligne 164 */ cmd.run(op, imageSource, resolver.createName(imageSource));
}
}
public static void main(String[] args) throws IOException, InfoException, InterruptedException, IM4JavaException {
//constructeur de la classe Resize
Resize resize = new Resize("C:/uploaded","C:/Program Files/ImageMagick-6.7.0-Q16", "C:/uploaded1", "jpg", "jpg", 180, 120);
/* ligne 171 */ resize.resizeFolder(); |
Partager