Fix local location reading.

master
sigonasr2 4 years ago
parent 2e03a7591a
commit 05e886c61b
  1. 8
      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));

Loading…
Cancel
Save