Improve test utility
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 13 Apr 2023 04:54:38 +0000 (06:54 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 13 Apr 2023 04:54:38 +0000 (06:54 +0200)
org.argeo.app.core/src/org/argeo/app/image/ImageProcessor.java

index 72c334f31b63bea9c5a8ac56c47dab0be6403e1a..eab49df64c3b24fa619b4414f3b9cb7bccb4fc6e 100644 (file)
@@ -196,13 +196,22 @@ public class ImageProcessor {
        }
 
        public static void main(String[] args) throws Exception {
+               if (args.length < 2)
+                       throw new IllegalArgumentException(
+                                       "Usage: " + ImageProcessor.class.getSimpleName() + " <source image> <target image>");
                Path imagePath = Paths.get(args[0]);
                Path targetPath = Paths.get(args[1]);
 
+               System.out.println("## Source metadata:");
+               try (InputStream in = Files.newInputStream(imagePath)) {
+                       metadataExample(in, null);
+               }
+
                ImageProcessor imageProcessor = new ImageProcessor(() -> Files.newInputStream(imagePath),
                                () -> Files.newOutputStream(targetPath));
                imageProcessor.process();
 
+               System.out.println("## Target metadata:");
                try (InputStream in = Files.newInputStream(targetPath)) {
                        metadataExample(in, null);
                }