From bb9f8c68f284497ed6d94fdc7ab23ce8c7a6aac7 Mon Sep 17 00:00:00 2001
From: ulrich <not disclosed>
Date: Sun, 04 Mar 2018 13:25:36 +0000
Subject: [PATCH] Umgestellt auf Thumbnailator

---
 src/java/de/uhilger/filecms/api/HtmlExportService.java |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/java/de/uhilger/filecms/api/HtmlExportService.java b/src/java/de/uhilger/filecms/api/HtmlExportService.java
index 8368466..56c726f 100644
--- a/src/java/de/uhilger/filecms/api/HtmlExportService.java
+++ b/src/java/de/uhilger/filecms/api/HtmlExportService.java
@@ -20,11 +20,7 @@
 
 package de.uhilger.filecms.api;
 
-import de.uhilger.filecms.data.Bild;
-import java.awt.Container;
-import java.awt.Image;
-import java.awt.MediaTracker;
-import java.awt.Toolkit;
+import de.uhilger.wbx.Bild;
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileFilter;
@@ -34,6 +30,7 @@
 import java.io.PrintWriter;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+import net.coobird.thumbnailator.Thumbnails;
 import org.apache.commons.io.FileUtils;
 
 /**
@@ -190,6 +187,16 @@
           }
           String outFileName = new File(dir, tnFileName.toString()).getAbsolutePath();
           logger.fine("outFileName: " + outFileName);
+          
+        try {
+          Thumbnails.of(absPath)
+                  .size(bild.getVariantenGroesse(Bild.WINZIG), bild.getVariantenGroesse(Bild.WINZIG))
+                  .keepAspectRatio(true)
+                  .toFile(outFileName);
+        } catch (IOException ex) {
+          logger.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
+        }
+          /*
           Image image = Toolkit.getDefaultToolkit().getImage(absPath);
           MediaTracker mediaTracker = new MediaTracker(new Container());
           mediaTracker.addImage(image, 0);
@@ -203,7 +210,8 @@
             }
           } catch (InterruptedException | IOException ex) {
             logger.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
-          }      
+          } 
+          */
         }
       }
     } else {

--
Gitblit v1.9.3