Explorar o código

Merge branch 'release-4.15.0' into release

dengsixing hai 13 horas
pai
achega
0c98b1a9ea

+ 6 - 2
src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java

@@ -183,7 +183,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
             Map<String, String> uploadMap = new HashMap<>();
 
             //切图
-            String fragmentCmd = "vips dzsave --tile-size "  + tileSize + " " + origFilePath + " " +  workPath;
+            String tempFilePath = workPath + "/temp_rotated.v";
+            String autorotCmd = "docker run --rm --security-opt seccomp=unconfined --pids-limit=4096 -v /mnt:/mnt vips:8.15.1 vips autorot " + origFilePath + " " + tempFilePath;
+            CmdUtils.callLine(autorotCmd);
+            String fragmentCmd = "docker run --rm --security-opt seccomp=unconfined --pids-limit=4096 -v /mnt:/mnt vips:8.15.1 vips dzsave --tile-size "  + tileSize + " " + tempFilePath + " " + workPath;
+            log.info("fragmentCmd:{}" + fragmentCmd);
             CmdUtils.callLine(fragmentCmd);
             if(!ComputerUtil.checkComputeCompleted(dziPath, 5, 200)){
                 throw new BusinessException(ErrorCode.FAILURE_CODE_5052);
@@ -203,7 +207,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
             Integer maxSize = height > width ? height : width;
             if(maxSize > size){
                 String thumbnailPath =  workPath + "/" + thumbnailName;
-                String scaleCmd = "vipsthumbnail " + origFilePath  + " -s " + size + " -o " + thumbnailPath;
+                String scaleCmd = "docker run --rm --security-opt seccomp=unconfined --pids-limit=4096 -v /mnt:/mnt vips:8.15.1 vipsthumbnail " + origFilePath  + " -s " + size + " -o " + thumbnailPath;
                 CmdUtils.callLine(scaleCmd);
                 if(!ComputerUtil.checkComputeCompleted(thumbnailPath, 5, 200)){
                     throw new BusinessException(ErrorCode.FAILURE_CODE_5052);