2 u010384420 u010384420 于 2014.03.05 00:02 提问

图片Exif信息修改代码编译时报错

import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import com.drew.imaging.ImageProcessingException;
import com.drew .imaging .jpeg.JpegMetadataReader;
import com.drew.metadata .Directory;
import com.drew .metadata.Metadata;
import com.drew.metadata .Tag;
import com.drew.metadata.exif.*;
import mediautil.image.jpeg.*;
import java.io.FileOutputStream;
public static void main(String[] args) throws Exception
{
LLJTran llj = new LLJTran(new File("E:\2012_07_17\IMG_0665.JPG"));

       // readImage(llj, true, LLJTran.READ_INFO, 0, 0);
        llj.read(LLJTran.READ_INFO,true);
        mediautil.image.jpeg.Exif  exifq=(Exif)llj.getImageInfo();
        Entry entry = exifq.getTagValue(Exif.USERCOMMENT, true);
        entry.setValue(0,"xxxxxxxxxxx");
        llj.refreshAppx();
        FileOutputStream nhop = new      FileOutputStream("E:\\2012_07_17\\IMG_0665.JPG");
        llj.xferInfo(null, nhop, LLJTran.REPLACE, LLJTran.REPLACE);
        nhop.close();

}
总是报这个错。mediautil.image.jpeg.JPEG cannot be cast to mediautil.image.jpeg.Exif

Csdn user default icon
上传中...
上传图片
插入图片