From ce68049d5da8f3006b4c97e674c04623f9d67992 Mon Sep 17 00:00:00 2001 From: xamidev Date: Wed, 14 Jan 2026 21:50:40 +0100 Subject: [PATCH] watermark ok --- pom.xml | 5 ++ src/main/java/org/example/Main.java | 89 +++++++++++++++++++++-------- 2 files changed, 70 insertions(+), 24 deletions(-) diff --git a/pom.xml b/pom.xml index 55d8067..544e2e2 100644 --- a/pom.xml +++ b/pom.xml @@ -19,6 +19,11 @@ ij 1.51h + + commons-io + commons-io + 2.15.1 + \ No newline at end of file diff --git a/src/main/java/org/example/Main.java b/src/main/java/org/example/Main.java index 8c4f635..aa2f4b9 100644 --- a/src/main/java/org/example/Main.java +++ b/src/main/java/org/example/Main.java @@ -2,38 +2,34 @@ package org.example; import ij.IJ; import ij.ImagePlus; -import ij.process.ImageProcessor; +import ij.process.ImageConverter; +import org.apache.commons.io.FilenameUtils; import java.awt.*; +import java.awt.image.BufferedImage; import java.io.File; -/* -TODO: -- Parse properly the CLI arguments -- Add error handling -- Write many lines with an angle -- Write for any image (format & responsiveness) -- optional: Export to PDF? - */ - public class Main { public static void main(String[] args) { if (args.length == 0) { - System.out.println("Usage: java -jar watermark.jar -s [-o ]"); + System.out.println("librewatmark - libre watermark tool\nUsage: -s [-o ]"); System.exit(0); } + String filename = null; File f = null; + String watermark = null; + String outputfile = null; for (int i=0; i