java获取图片原始尺寸
2017-01-05 17:18
330 查看
java获取图片原始尺寸
URL url = null; InputStream is = null; BufferedImage img = null; try { url = new URL(picurl); is = url.openStream(); img = ImageIO.read(is); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { is.close(); } catch (IOException e) { e.printStackTrace(); } } //System.out.println(img.getHeight()+"/"+img.getWidth()); String str = "{\"width\":\""+img.getWidth()+"\",\"height\":\""+img.getHeight()+"\"}"; out.print(str);
相关文章推荐
- JAVA获取图片大小和尺寸【转】
- JAVA获取图片大小和尺寸
- 使用js获取图片原始尺寸
- JAVA获取图片大小和尺寸
- JavaScript获取图片的原始尺寸
- JavaScript获取页面图片原始尺寸
- java开发_比较使用ImageReader和BufferedImage获取图片尺寸总结
- 如何用JavaScript在浏览器端获取图片的原始尺寸大小?
- javascript 获取图片原始尺寸
- JavaScript获取图片的原始尺寸
- JAVA获取图片大小和尺寸
- 用JavaScript获取原始图片尺寸
- JavaScript获取图片的原始尺寸
- JAVA获取图片大小和尺寸
- JAVA获取图片大小和尺寸
- java获取图片大小和尺寸
- js获取图片的原始尺寸
- java 获取图片大小(尺寸)
- 积跬步,聚小流------java获取图片的尺寸
- Java获取上传图片的尺寸