]> git.argeo.org Git - gpl/argeo-suite.git/blobdiff - org.argeo.app.core/src/org/argeo/app/image/ImageProcessor.java
Improve test utility
[gpl/argeo-suite.git] / org.argeo.app.core / src / org / argeo / app / image / ImageProcessor.java
index 7fd308de8d1e6c87b21113b0aaf9b20d223e159f..eab49df64c3b24fa619b4414f3b9cb7bccb4fc6e 100644 (file)
@@ -66,9 +66,9 @@ public class ImageProcessor {
                                                Files.deleteIfExists(temp);
                                        }
                                } else {
-                                       try (OutputStream out = outSupplier.call()) {
-                                               copyWithMetadata(() -> in, metadata);
-                                       }
+//                                     try (OutputStream out = outSupplier.call()) {
+                                       copyWithMetadata(() -> in, metadata);
+//                                     }
                                }
                        }
                } catch (Exception e) {
@@ -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);
                }