diff --git a/src/main/java/com/example/demo/Controller.java b/src/main/java/com/example/demo/Controller.java index 00ed61d..232f9d4 100644 --- a/src/main/java/com/example/demo/Controller.java +++ b/src/main/java/com/example/demo/Controller.java @@ -143,8 +143,12 @@ public class Controller { BufferedImage img = null; if (url.contains("http://projectdivar.com/")) { //System.out.println("Locally available. "+"./"+url.replace("http://projectdivar.com/", "")); - f = new File("../../server/"+url.replace("http://projectdivar.com/", "")); - img = ImageIO.read(f); + /*f = new File("../../server/"+url.replace("http://projectdivar.com/", "")); + img = ImageIO.read(f);*/ + img = ImageIO.read(new URL(url)); + img = ImageIO.read(new URL(url)); + f = new File("temp.png"); + ImageIO.write(img,"png",f); } else { /*downloadFileFromUrl(url,"temp"); //BufferedImage img = ImageUtils.toBufferedImage(ImageIO.read(new File("temp")).getScaledInstance(1227, 690, Image.SCALE_SMOOTH));