j'ai un nouveau problème dans image magick qui a l'air étrange .. j'utilise mac osx snow léopard et j'ai installé image magick sur elle et ça fonctionne bien sur la commande .. mais quand Je l'appelle de la classe Grails comme ce qui suit snippet il me donne "Impossible de lancer le programme "convertir": error = 2, Aucun fichier ou répertoire"problème dans imagemagick et grails
le code est: -
public static boolean resizeImage(String srcPath, String destPath,String size) {
ArrayList<String> command = new ArrayList<String>(10);
command.add("convert");
command.add("-geometry");
command.add(size);
command.add("-quality");
command.add("100");
command.add(srcPath);
command.add(destPath);
System.out.println(command);
return exec((String[])command.toArray(new String[1]));
}
private static boolean exec(String[] command) {
Process proc;
try {
//System.out.println("Trying to execute command " + Arrays.asList(command));
proc = Runtime.getRuntime().exec(command);
} catch (IOException e) {
System.out.println("IOException while trying to execute ");
for(int i =0 ; i<command.length; i++) {
System.out.println(command[i]);
}
return false;
}
//System.out.println("Got process object, waiting to return.");
int exitStatus;
while (true) {
try {
exitStatus = proc.waitFor();
break;
} catch (java.lang.InterruptedException e) {
System.out.println("Interrupted: Ignoring and waiting");
}
}
if (exitStatus != 0) {
System.out.println("Error executing command: " + exitStatus);
}
return (exitStatus == 0);
}
i 'ai essayé la commande normale comme ls et c'est ok donc le problème est que les grails ne peuvent pas trouver la commande de conversion elle-même .. est-ce un os p roblem ou quelque chose?
J'utilise NetBeans il est donc en utilisant la jetée je suppose .. alors que puis-je faire –