| | |
| | |
|
| | | 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;
|
| | |
| | | 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;
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | | 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)
|
| | | .outputQuality(0.7)
|
| | | .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);
|
| | |
| | | }
|
| | | } catch (InterruptedException | IOException ex) {
|
| | | logger.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
|
| | | } |
| | | } |
| | | */
|
| | | }
|
| | | }
|
| | | } else {
|