1
2
3
4
5 package gboat2.attachment.watermark;
6
7
8
9
10
11
12
13
14
15 public abstract class WatermarkFactory {
16
17
18
19
20
21
22
23
24 public static void watermark(String srcImg, String targetImg, String watermarkImg) throws Exception {
25 WatermarkStrategy strategy = new IM4JavaWatermarkStrategy();
26 try {
27 strategy.watermark(srcImg, targetImg, watermarkImg);
28 } catch (Throwable e) {
29 strategy = new JMagickWatermarkStrategy();
30 strategy.watermark(srcImg, targetImg, watermarkImg);
31 }
32 }
33
34 }