Prevent re-downloading file if it's locally available on the server.
BIN
files/Blackjack.jpg
Normal file
After Width: | Height: | Size: 422 KiB |
BIN
files/DECORATOR_EXplay_436_100_1_0_6_93.52.png
Normal file
After Width: | Height: | Size: 1.5 MiB |
BIN
files/img.jpg
Normal file
After Width: | Height: | Size: 211 KiB |
BIN
files/img0.jpg
Normal file
After Width: | Height: | Size: 189 KiB |
BIN
files/img1.jpg
Normal file
After Width: | Height: | Size: 179 KiB |
BIN
files/img10.png
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
files/img2.png
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
files/img3.png
Normal file
After Width: | Height: | Size: 1.5 MiB |
BIN
files/img4.png
Normal file
After Width: | Height: | Size: 1.5 MiB |
BIN
files/img5.png
Normal file
After Width: | Height: | Size: 1.5 MiB |
BIN
files/img6.png
Normal file
After Width: | Height: | Size: 1.6 MiB |
BIN
files/img7.png
Normal file
After Width: | Height: | Size: 1.6 MiB |
BIN
files/img8.png
Normal file
After Width: | Height: | Size: 1.8 MiB |
BIN
files/img9.png
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
files/plays/test
Normal file
After Width: | Height: | Size: 1.4 MiB |
@ -134,9 +134,15 @@ public class Controller {
|
||||
//System.out.println(body);
|
||||
try {
|
||||
System.out.println(url);
|
||||
downloadFileFromUrl(url,"temp");
|
||||
//BufferedImage img = ImageUtils.toBufferedImage(ImageIO.read(new File("temp")).getScaledInstance(1227, 690, Image.SCALE_SMOOTH));
|
||||
BufferedImage img = ImageIO.read(new File("temp"));
|
||||
BufferedImage img = null;
|
||||
if (url.contains("http://projectdivar.com/files/")) {
|
||||
//System.out.println("Locally available.");
|
||||
img = ImageIO.read(new File("files",url.replace("http://projectdivar.com/files/", "")));
|
||||
} else {
|
||||
downloadFileFromUrl(url,"temp");
|
||||
//BufferedImage img = ImageUtils.toBufferedImage(ImageIO.read(new File("temp")).getScaledInstance(1227, 690, Image.SCALE_SMOOTH));
|
||||
img = ImageIO.read(new File("temp"));
|
||||
}
|
||||
if (img.getWidth()!=1200) {
|
||||
//Resize.
|
||||
img = ImageUtils.toBufferedImage(ImageIO.read(new File("temp")).getScaledInstance(1200, 675, Image.SCALE_SMOOTH));
|
||||
|