From 94c0d43d2765488d715bffe426934ed7caa8f4f2 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 25 Jul 2016 11:27:38 +0300 Subject: convert.sh -> Thumbnailator (www, api) --- juick-www/src/main/java/com/juick/www/NewMessage.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'juick-www/src/main/java/com') diff --git a/juick-www/src/main/java/com/juick/www/NewMessage.java b/juick-www/src/main/java/com/juick/www/NewMessage.java index c6a1aae8..d64fce78 100644 --- a/juick-www/src/main/java/com/juick/www/NewMessage.java +++ b/juick-www/src/main/java/com/juick/www/NewMessage.java @@ -214,7 +214,14 @@ public class NewMessage { String fname = mid + "." + attachmentType; String attachmentURL = "http://i.juick.com/photos-1024/" + fname; - Runtime.getRuntime().exec("/var/www/juick.com/cgi/p-convert.sh /var/www/juick.com/i/tmp/" + attachmentFName + " " + fname); + Path origName = Paths.get(imgDir, "p", fname); + Files.move(Paths.get(tmpDir, attachmentFName), origName); + Thumbnails.of(origName.toFile()).size(1024, 1024).outputQuality(0.9) + .toFile(Paths.get(imgDir, "photos-1024", fname).toFile()); + Thumbnails.of(origName.toFile()).size(512, 512).outputQuality(0.9) + .toFile(Paths.get(imgDir, "photos-512", fname).toFile()); + Thumbnails.of(origName.toFile()).size(160, 120).outputQuality(0.9) + .toFile(Paths.get(imgDir, "ps", fname).toFile()); body = attachmentURL + "\n" + body; XOOB xoob = new XOOB(); -- cgit v1.2.3