From e6e51acf09648ffb94eeecfa74a180e25b784e67 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 2 Nov 2016 17:23:29 +0300 Subject: www: target avatars are always png --- juick-www/src/main/java/com/juick/www/Settings.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'juick-www/src/main/java/com') diff --git a/juick-www/src/main/java/com/juick/www/Settings.java b/juick-www/src/main/java/com/juick/www/Settings.java index 0602bff1..5a159362 100644 --- a/juick-www/src/main/java/com/juick/www/Settings.java +++ b/juick-www/src/main/java/com/juick/www/Settings.java @@ -157,8 +157,10 @@ public class Settings { info.setDescription(request.getParameter("descr")); String avatarTmpPath = Utils.receiveMultiPartFile(request, "avatar"); if (StringUtils.isNotEmpty(avatarTmpPath)) { - String targetName = String.format("%s.%s", visitor.getUID(), FilenameUtils.getExtension(avatarTmpPath)); - Path ao = Paths.get(imgPath, "ao", targetName); + String originalExtension = FilenameUtils.getExtension(avatarTmpPath); + String originalName = String.format("%s.%s", visitor.getUID(), originalExtension); + String targetName = String.format("%s.png", visitor.getUID()); + Path ao = Paths.get(imgPath, "ao", originalName); Path a = Paths.get(imgPath, "a", targetName); Path as = Paths.get(imgPath, "as", targetName); Files.move(Paths.get(Utils.getTmpDir(), avatarTmpPath), ao); -- cgit v1.2.3