nutzam/nutz — Issue #135: Images.java无法处理源文件是URL link的图片
Author: ywjno
Created: 2012-01-31 03:59:04+00:00
State: open

代码如下

import java.io.IOException;

import org.nutz.img.Images;

public class ImagesTest {

public static void main(String[] args) throws IOException {
Images.zoomScale("http://www.google.com.hk/intl/zh-CN/images/logo_cn.png", "c:/images_test_by_google_logo.jpg", 600, 800, null);
System.out.println("ok");
}

}

在控制台抛出错误为

Exception in thread "main" java.lang.RuntimeException: Fail to find image file 'http://www.google.com.hk/intl/zh-CN/images/logo_cn.png'!
at org.nutz.lang.Lang.makeThrow(Lang.java:84)
at org.nutz.img.Images.zoomScale(Images.java:173)
at ImagesTest.main(ImagesTest.java:9)