How to resize images in a directory?
问题 This code attempts to resize images in a directory called "imgs". Unfortunately for some reason when I uncomment the listFiles(..) loop ImageIO.read(sourceImageFile) will return null. Yet processing the same file straightaway outside the loop ( res("imgs/foto_3.jpg") ) works. So apparently, this loop is preventing the files from being read. Solutions? import java.awt.image.*; import java.io.*; import javax.imageio.*; import static org.imgscalr.Scalr.*; public class App { public static void