Commit dc42eb71 by songxiang

注释没用的代码

parent b975c2a8
......@@ -815,28 +815,28 @@ public class ImageUtils {
* 源文件上传后的路径,主要用于子文件上传时对应http文件路径
*/
public static UploadResultInfo toWebp(String fileUrl) {
String fileNameAll = FileUtils.getFileNameAll(fileUrl);
String localFilePath = FilePathConst.DOWNLOAD_PATH + fileNameAll;
FileUtils.downloadFileFromUrl(fileUrl, localFilePath);
String tragetPath = null;
try {
tragetPath = com.dcg.util.ImageUtils.transcodeToWebp(localFilePath, 80);
} catch (Exception e) {
LOGGER.error("【IMAGE】图片转换成webp失败:" + e.getMessage(), e);
return null;
}
if (StringUtils.isEmpty(tragetPath)) {
return null;
}
try {
return OssUtils.uploadLocalFile4Child(tragetPath, fileUrl);
} catch (Exception e) {
LOGGER.error("【IMAGE】图片转换成webp,上传失败:" + e.getMessage(), e);
} finally {
FileUtils.deleteFile(localFilePath);
FileUtils.deleteFile(tragetPath);
}
return null;
// String fileNameAll = FileUtils.getFileNameAll(fileUrl);
// String localFilePath = FilePathConst.DOWNLOAD_PATH + fileNameAll;
// FileUtils.downloadFileFromUrl(fileUrl, localFilePath);
// String tragetPath = null;
// try {
// tragetPath = com.dcg.util.ImageUtils.transcodeToWebp(localFilePath, 80);
// } catch (Exception e) {
// LOGGER.error("【IMAGE】图片转换成webp失败:" + e.getMessage(), e);
// return null;
// }
// if (StringUtils.isEmpty(tragetPath)) {
// return null;
// }
// try {
// return OssUtils.uploadLocalFile4Child(tragetPath, fileUrl);
// } catch (Exception e) {
// LOGGER.error("【IMAGE】图片转换成webp,上传失败:" + e.getMessage(), e);
// } finally {
// FileUtils.deleteFile(localFilePath);
// FileUtils.deleteFile(tragetPath);
// }
// return null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment