aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-07-25 11:27:38 +0300
committerGravatar Vitaly Takmazov2016-07-27 13:55:51 +0300
commit94c0d43d2765488d715bffe426934ed7caa8f4f2 (patch)
tree400e3aa57d9aa09c0ae4312b67334d01efc23dfa /juick-www/src/main/java/com/juick/www
parentf3fce84310a189d9be295268e3207d392509e466 (diff)
convert.sh -> Thumbnailator (www, api)
Diffstat (limited to 'juick-www/src/main/java/com/juick/www')
-rw-r--r--juick-www/src/main/java/com/juick/www/NewMessage.java9
1 files changed, 8 insertions, 1 deletions
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();