java获取文件exif信息-添加图片文字水印

需要添加jar:metadata-extractor-2.3.1.jar
代码:
Java代码 复制代码  收藏代码
  1. public class ImageInfo {   
  2.     private Integer id;   
  3.     private String author;   
  4.     private String desc;   
  5.     private String date;   
  6.     private String width;   
  7.     private String height;   
  8.     public ImageInfo(Integer id, String author, String desc,String date) {   
  9.         super();   
  10.         this.id = id;   
  11.         this.author = author;   
  12.         this.desc = desc;   
  13.         this.date=date;   
  14.     }   
  15.     public ImageInfo(String author, String desc) {   
  16.         super();   
  17.         this.id = 0;   
  18.         this.author = author;   
  19.         this.desc = desc;   
  20.     }   
  21.     public ImageInfo() {   
  22.         super();   
  23.         // TODO Auto-generated constructor stub   
  24.     }   
  25.     /**  
  26.      * @return the id  
  27.      */  
  28.     public Integer getId() {   
  29.         return id;   
  30.     }   
  31.     /**  
  32.      * @param id the id to set  
  33.      */  
  34.     public void setId(Integer id) {   
  35.         this.id = id;   
  36.     }   
  37.     /**  
  38.      * @return the author  
  39.      */  
  40.     public String getAuthor() {   
  41.         return author;   
  42.     }   
  43.     /**  
  44.      * @param author the author to set  
  45.      */  
  46.     public void setAuthor(String author) {   
  47.         this.author = author;   
  48.     }   
  49.     /**  
  50.      * @return the desc  
  51.      */  
  52.     public String getDesc() {   
  53.         return desc;   
  54.     }   
  55.     /**  
  56.      * @param desc the desc to set  
  57.      */  
  58.     public void setDesc(String desc) {   
  59.         this.desc = desc;   
  60.     }   
  61.        
  62.        
  63.     /* (non-Javadoc)  
  64.      * @see java.lang.Object#toString()  
  65.      */  
  66.        
  67.     /**  
  68.      * @return the date  
  69.      */  
  70.     public String getDate() {   
  71.         return date;   
  72.     }   
  73.     /**  
  74.      * @param date the date to set  
  75.      */  
  76.     public void setDate(String date) {   
  77.         this.date = date;   
  78.     }   
  79.         
  80.     /**  
  81.      * @return the width  
  82.      */  
  83.     public String getWidth() {   
  84.         return width;   
  85.     }   
  86.     /**  
  87.      * @param width the width to set  
  88.      */  
  89.     public void setWidth(String width) {   
  90.         this.width = width;   
  91.     }   
  92.     /**  
  93.      * @return the height  
  94.      */  
  95.     public String getHeight() {   
  96.         return height;   
  97.     }   
  98.     /**  
  99.      * @param height the height to set  
  100.      */  
  101.     public void setHeight(String height) {   
  102.         this.height = height;   
  103.     }   
  104.     /* (non-Javadoc)  
  105.      * @see java.lang.Object#toString()  
  106.      */  
  107.     @Override  
  108.     public String toString() {   
  109.         return "ImageInfo [id=" + id + ", author=" + author + ", desc=" + desc   
  110.                 + ", date=" + date + ", width=" + width + ", height=" + height   
  111.                 + "]";   
  112.     }   
  113.         
  114.        
  115.        
  116. }  
public class ImageInfo {
	private Integer id;
	private String author;
	private String desc;
	private String date;
	private String width;
	private String height;
	public ImageInfo(Integer id, String author, String desc,String date) {
		super();
		this.id = id;
		this.author = author;
		this.desc = desc;
		this.date=date;
	}
	public ImageInfo(String author, String desc) {
		super();
		this.id = 0;
		this.author = author;
		this.desc = desc;
	}
	public ImageInfo() {
		super();
		// TODO Auto-generated constructor stub
	}
	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	/**
	 * @return the author
	 */
	public String getAuthor() {
		return author;
	}
	/**
	 * @param author the author to set
	 */
	public void setAuthor(String author) {
		this.author = author;
	}
	/**
	 * @return the desc
	 */
	public String getDesc() {
		return desc;
	}
	/**
	 * @param desc the desc to set
	 */
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	
	/**
	 * @return the date
	 */
	public String getDate() {
		return date;
	}
	/**
	 * @param date the date to set
	 */
	public void setDate(String date) {
		this.date = date;
	}
	 
	/**
	 * @return the width
	 */
	public String getWidth() {
		return width;
	}
	/**
	 * @param width the width to set
	 */
	public void setWidth(String width) {
		this.width = width;
	}
	/**
	 * @return the height
	 */
	public String getHeight() {
		return height;
	}
	/**
	 * @param height the height to set
	 */
	public void setHeight(String height) {
		this.height = height;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "ImageInfo [id=" + id + ", author=" + author + ", desc=" + desc
				+ ", date=" + date + ", width=" + width + ", height=" + height
				+ "]";
	}
	 
	
	
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值