|
|
@@ -109,19 +109,11 @@ public class TsfCommonController extends TsfBaseController {
|
|
|
*/
|
|
|
@PostMapping("/file/upload")
|
|
|
@ResponseBody
|
|
|
- public GagaUploadedFileInfo uploadFile(@RequestParam(value = "subDir") String subDir, @RequestParam(value = "policy", required = false) String policy, MultipartFile file) throws IOException, ImageProcessingException, MetadataException {
|
|
|
+ public GagaUploadedFileInfo uploadFile(@RequestParam(value = "subDir") String subDir, @RequestParam(value = "policy", required = false) String policy, MultipartFile file) throws IOException{
|
|
|
if (StringUtils.isEmpty(policy)) {
|
|
|
policy = "default";
|
|
|
}
|
|
|
- int orientation = 1;
|
|
|
- Metadata metadata = ImageMetadataReader.readMetadata(convert(file));
|
|
|
|
|
|
- Directory directory = metadata.getFirstDirectoryOfType(ExifIFD0Directory.class);
|
|
|
- if(directory != null) {
|
|
|
- orientation = directory.getInt(ExifIFD0Directory.TAG_ORIENTATION);
|
|
|
- }
|
|
|
-
|
|
|
- log.info("orientation: {}", orientation);
|
|
|
String targetPath = GagaFileUtil.getConcatenationPath(env.getProperty("upload." + policy + ".target.path"), subDir);
|
|
|
|
|
|
GagaFileUploadUtil fuUtil = new GagaFileUploadUtil(targetPath, Long.parseLong(env.getProperty("upload." + policy + ".max.size")), env.getProperty("upload." + policy + ".allow.extension"), env.getProperty("upload." + policy + ".view"));
|