@@ -23,21 +23,25 @@ namespace Resizer {
2323 public class Resizer : Object {
2424 public static int maxWidth = 1000 ;
2525 public static int maxHeight = 1000 ;
26- public static File file ;
26+ public static File [] files ;
2727
2828 public static void create_resized_image () {
29- var input_name = file. get_path ();
30- var output_name = get_output_name (input_name, maxWidth, maxHeight );
29+ foreach ( var file in files) {
30+ stdout . printf ( " resizing: %s\n " , file . get_path () );
3131
32- try {
33- string [] command = get_command(input_name, output_name, maxWidth, maxHeight);
34- new Subprocess .newv (command, SubprocessFlags . STDERR_PIPE );
35- // Subprocess subprocess = new Subprocess.newv (command, SubprocessFlags.STDERR_PIPE);
36- // if (subprocess.wait_check ()) {
37- // stdout.printf ("Success!\n");
38- // }
39- } catch (Error e) {
40- stderr. printf (" Error during resize: %s " , e. message);
32+ var input_name = file. get_path ();
33+ var output_name = get_output_name (input_name, maxWidth, maxHeight);
34+
35+ try {
36+ string [] command = get_command(input_name, output_name, maxWidth, maxHeight);
37+ new Subprocess .newv (command, SubprocessFlags . STDERR_PIPE );
38+ // Subprocess subprocess = new Subprocess.newv (command, SubprocessFlags.STDERR_PIPE);
39+ // if (subprocess.wait_check ()) {
40+ // stdout.printf ("Success!\n");
41+ // }
42+ } catch (Error e) {
43+ stderr. printf (" Error during resize: %s " , e. message);
44+ }
4145 }
4246 }
4347 public static string get_output_name (string input , int width , int height ) {
0 commit comments