public String tifTransfertoJpg(String filePath,String fileName) throws IOException{
/* tif转换到jpg格式 */
String input = filePath+fileName;
String output = filePath+fileName.substring(0, StringUtils.lastIndexOf(fileName, "."))+".jpg";
RenderedOp src = JAI.create("fileload", input);
OutputStream os = null;
os = new FileOutputStream(output);
JPEGEncodeParam param = new JPEGEncodeParam();
// 指定格式类型,jpg 属于 JPEG 类型
ImageEncoder enc = ImageCodec.createImageEncoder("JPEG", os, param);
enc.encode(src);
os.close();
return "ftp/"+fileName.substring(0, StringUtils.indexOf(fileName, "."))+".jpg";
}