开发者

Retrieve the dimensions of an image in the filesystem

How can I r开发者_Go百科etrieve the dimensions of an image (typically jpeg, png, jpg and gif), in the local filesystem with Java?


You can use java's image class to get image attributes. Here is the sample -

BufferedImage img = ImageIO.read(new File("imageFilePath"));
int height = img.getHeight();
int width = img.getWidth();


how about this: getting image metadata

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜