首页>代码>java获取图片的metadata的方法>/metadata-extractor/src/com/javaniu/test/Main.java
package com.javaniu.test;

import java.io.File;

import com.drew.imaging.jpeg.JpegMetadataReader;
import com.drew.metadata.Directory;
import com.drew.metadata.Metadata;
import com.drew.metadata.Tag;

public class Main {

	public static void main(String[] args) {
		String root = Main.class.getResource("/").getFile();
		File withExif = new File(root + "withExifAndIptc.jpg");
		try {
			Metadata metadata = JpegMetadataReader.readMetadata(withExif);
			for (Directory directory : metadata.getDirectories()) {
				for (Tag tag : directory.getTags()) {
					System.out.println(tag);
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
最近下载更多
yhxmbb1026  LV1 2021年3月5日
mayunli288  LV1 2021年2月16日
chensi_  LV1 2020年8月13日
wlax99  LV12 2019年12月3日
稀饭囡  LV9 2017年11月29日
zhanghuaizhu  LV2 2017年6月6日
821497507  LV12 2017年5月20日
win10skiller  LV2 2017年4月15日
secretmx  LV2 2017年2月24日
new_obj  LV3 2017年1月18日
最近浏览更多
heqian  LV16 2023年1月10日
微信网友_5857910989295616  LV1 2022年3月4日
2294878733  LV1 2021年10月20日
而我认为  LV6 2021年9月26日
mayunli288  LV1 2021年2月16日
dongzhan  LV12 2020年12月8日
chensi_  LV1 2020年8月13日
caozhaoqi83  LV5 2020年6月8日
Jokerbean  LV1 2020年5月5日
liangju666  LV6 2020年3月3日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友