feat(core): 非标分辨率改为每1024px一档并扩展至19K
This commit is contained in:
+243
-33
@@ -154,27 +154,47 @@ func handleGifImage(path string) {
|
||||
// 处理垂直图片
|
||||
func handleVerticalImage(currentImagePath string, height int) {
|
||||
// 非标规格
|
||||
if height < 1000 {
|
||||
if height < 1024 {
|
||||
vars.ImageVerticalNormalList = append(vars.ImageVerticalNormalList, currentImagePath)
|
||||
} else if height < 2000 {
|
||||
} else if height < 2048 {
|
||||
vars.ImageVertical1KList = append(vars.ImageVertical1KList, currentImagePath)
|
||||
} else if height < 3000 {
|
||||
} else if height < 3072 {
|
||||
vars.ImageVertical2KList = append(vars.ImageVertical2KList, currentImagePath)
|
||||
} else if height < 4000 {
|
||||
} else if height < 4096 {
|
||||
vars.ImageVertical3KList = append(vars.ImageVertical3KList, currentImagePath)
|
||||
} else if height < 5000 {
|
||||
} else if height < 5120 {
|
||||
vars.ImageVertical4KList = append(vars.ImageVertical4KList, currentImagePath)
|
||||
} else if height < 6000 {
|
||||
} else if height < 6144 {
|
||||
vars.ImageVertical5KList = append(vars.ImageVertical5KList, currentImagePath)
|
||||
} else if height < 7000 {
|
||||
} else if height < 7168 {
|
||||
vars.ImageVertical6KList = append(vars.ImageVertical6KList, currentImagePath)
|
||||
} else if height < 8000 {
|
||||
} else if height < 8192 {
|
||||
vars.ImageVertical7KList = append(vars.ImageVertical7KList, currentImagePath)
|
||||
} else if height < 9000 {
|
||||
} else if height < 9216 {
|
||||
vars.ImageVertical8KList = append(vars.ImageVertical8KList, currentImagePath)
|
||||
} else if height < 10000 {
|
||||
} else if height < 10240 {
|
||||
vars.ImageVertical9KList = append(vars.ImageVertical9KList, currentImagePath)
|
||||
} else if height >= 10000 { // 提示请忽略
|
||||
} else if height < 11264 {
|
||||
vars.ImageVertical10KList = append(vars.ImageVertical10KList, currentImagePath)
|
||||
} else if height < 12288 {
|
||||
vars.ImageVertical11KList = append(vars.ImageVertical11KList, currentImagePath)
|
||||
} else if height < 13312 {
|
||||
vars.ImageVertical12KList = append(vars.ImageVertical12KList, currentImagePath)
|
||||
} else if height < 14336 {
|
||||
vars.ImageVertical13KList = append(vars.ImageVertical13KList, currentImagePath)
|
||||
} else if height < 15360 {
|
||||
vars.ImageVertical14KList = append(vars.ImageVertical14KList, currentImagePath)
|
||||
} else if height < 16384 {
|
||||
vars.ImageVertical15KList = append(vars.ImageVertical15KList, currentImagePath)
|
||||
} else if height < 17408 {
|
||||
vars.ImageVertical16KList = append(vars.ImageVertical16KList, currentImagePath)
|
||||
} else if height < 18432 {
|
||||
vars.ImageVertical17KList = append(vars.ImageVertical17KList, currentImagePath)
|
||||
} else if height < 19456 {
|
||||
vars.ImageVertical18KList = append(vars.ImageVertical18KList, currentImagePath)
|
||||
} else if height < 20480 {
|
||||
vars.ImageVertical19KList = append(vars.ImageVertical19KList, currentImagePath)
|
||||
} else if height >= 20480 { // 提示请忽略
|
||||
vars.ImageVerticalHKList = append(vars.ImageVerticalHKList, currentImagePath)
|
||||
}
|
||||
}
|
||||
@@ -237,27 +257,47 @@ func handleHorizontalImage(currentImagePath string, width int, height int) {
|
||||
return
|
||||
}
|
||||
// 非标规格
|
||||
if width < 1000 {
|
||||
if width < 1024 {
|
||||
vars.ImageHorizontalNormalList = append(vars.ImageHorizontalNormalList, currentImagePath)
|
||||
} else if width < 2000 {
|
||||
} else if width < 2048 {
|
||||
vars.ImageHorizontal1KList = append(vars.ImageHorizontal1KList, currentImagePath)
|
||||
} else if width < 3000 {
|
||||
} else if width < 3072 {
|
||||
vars.ImageHorizontal2KList = append(vars.ImageHorizontal2KList, currentImagePath)
|
||||
} else if width < 4000 {
|
||||
} else if width < 4096 {
|
||||
vars.ImageHorizontal3KList = append(vars.ImageHorizontal3KList, currentImagePath)
|
||||
} else if width < 5000 {
|
||||
} else if width < 5120 {
|
||||
vars.ImageHorizontal4KList = append(vars.ImageHorizontal4KList, currentImagePath)
|
||||
} else if width < 6000 {
|
||||
} else if width < 6144 {
|
||||
vars.ImageHorizontal5KList = append(vars.ImageHorizontal5KList, currentImagePath)
|
||||
} else if width < 7000 {
|
||||
} else if width < 7168 {
|
||||
vars.ImageHorizontal6KList = append(vars.ImageHorizontal6KList, currentImagePath)
|
||||
} else if width < 8000 {
|
||||
} else if width < 8192 {
|
||||
vars.ImageHorizontal7KList = append(vars.ImageHorizontal7KList, currentImagePath)
|
||||
} else if width < 9000 {
|
||||
} else if width < 9216 {
|
||||
vars.ImageHorizontal8KList = append(vars.ImageHorizontal8KList, currentImagePath)
|
||||
} else if width < 10000 {
|
||||
} else if width < 10240 {
|
||||
vars.ImageHorizontal9KList = append(vars.ImageHorizontal9KList, currentImagePath)
|
||||
} else if width >= 10000 { // 提示请忽略
|
||||
} else if width < 11264 {
|
||||
vars.ImageHorizontal10KList = append(vars.ImageHorizontal10KList, currentImagePath)
|
||||
} else if width < 12288 {
|
||||
vars.ImageHorizontal11KList = append(vars.ImageHorizontal11KList, currentImagePath)
|
||||
} else if width < 13312 {
|
||||
vars.ImageHorizontal12KList = append(vars.ImageHorizontal12KList, currentImagePath)
|
||||
} else if width < 14336 {
|
||||
vars.ImageHorizontal13KList = append(vars.ImageHorizontal13KList, currentImagePath)
|
||||
} else if width < 15360 {
|
||||
vars.ImageHorizontal14KList = append(vars.ImageHorizontal14KList, currentImagePath)
|
||||
} else if width < 16384 {
|
||||
vars.ImageHorizontal15KList = append(vars.ImageHorizontal15KList, currentImagePath)
|
||||
} else if width < 17408 {
|
||||
vars.ImageHorizontal16KList = append(vars.ImageHorizontal16KList, currentImagePath)
|
||||
} else if width < 18432 {
|
||||
vars.ImageHorizontal17KList = append(vars.ImageHorizontal17KList, currentImagePath)
|
||||
} else if width < 19456 {
|
||||
vars.ImageHorizontal18KList = append(vars.ImageHorizontal18KList, currentImagePath)
|
||||
} else if width < 20480 {
|
||||
vars.ImageHorizontal19KList = append(vars.ImageHorizontal19KList, currentImagePath)
|
||||
} else if width >= 20480 { // 提示请忽略
|
||||
vars.ImageHorizontalHKList = append(vars.ImageHorizontalHKList, currentImagePath)
|
||||
}
|
||||
}
|
||||
@@ -265,27 +305,47 @@ func handleHorizontalImage(currentImagePath string, width int, height int) {
|
||||
// 处理等比图片
|
||||
func handleSquareImage(currentImagePath string, width int) {
|
||||
// 非标规格
|
||||
if width < 1000 {
|
||||
if width < 1024 {
|
||||
vars.ImageSquareNormalList = append(vars.ImageSquareNormalList, currentImagePath)
|
||||
} else if width < 2000 {
|
||||
} else if width < 2048 {
|
||||
vars.ImageSquare1KList = append(vars.ImageSquare1KList, currentImagePath)
|
||||
} else if width < 3000 {
|
||||
} else if width < 3072 {
|
||||
vars.ImageSquare2KList = append(vars.ImageSquare2KList, currentImagePath)
|
||||
} else if width < 4000 {
|
||||
} else if width < 4096 {
|
||||
vars.ImageSquare3KList = append(vars.ImageSquare3KList, currentImagePath)
|
||||
} else if width < 5000 {
|
||||
} else if width < 5120 {
|
||||
vars.ImageSquare4KList = append(vars.ImageSquare4KList, currentImagePath)
|
||||
} else if width < 6000 {
|
||||
} else if width < 6144 {
|
||||
vars.ImageSquare5KList = append(vars.ImageSquare5KList, currentImagePath)
|
||||
} else if width < 7000 {
|
||||
} else if width < 7168 {
|
||||
vars.ImageSquare6KList = append(vars.ImageSquare6KList, currentImagePath)
|
||||
} else if width < 8000 {
|
||||
} else if width < 8192 {
|
||||
vars.ImageSquare7KList = append(vars.ImageSquare7KList, currentImagePath)
|
||||
} else if width < 9000 {
|
||||
} else if width < 9216 {
|
||||
vars.ImageSquare8KList = append(vars.ImageSquare8KList, currentImagePath)
|
||||
} else if width < 10000 {
|
||||
} else if width < 10240 {
|
||||
vars.ImageSquare9KList = append(vars.ImageSquare9KList, currentImagePath)
|
||||
} else if width >= 10000 {
|
||||
} else if width < 11264 {
|
||||
vars.ImageSquare10KList = append(vars.ImageSquare10KList, currentImagePath)
|
||||
} else if width < 12288 {
|
||||
vars.ImageSquare11KList = append(vars.ImageSquare11KList, currentImagePath)
|
||||
} else if width < 13312 {
|
||||
vars.ImageSquare12KList = append(vars.ImageSquare12KList, currentImagePath)
|
||||
} else if width < 14336 {
|
||||
vars.ImageSquare13KList = append(vars.ImageSquare13KList, currentImagePath)
|
||||
} else if width < 15360 {
|
||||
vars.ImageSquare14KList = append(vars.ImageSquare14KList, currentImagePath)
|
||||
} else if width < 16384 {
|
||||
vars.ImageSquare15KList = append(vars.ImageSquare15KList, currentImagePath)
|
||||
} else if width < 17408 {
|
||||
vars.ImageSquare16KList = append(vars.ImageSquare16KList, currentImagePath)
|
||||
} else if width < 18432 {
|
||||
vars.ImageSquare17KList = append(vars.ImageSquare17KList, currentImagePath)
|
||||
} else if width < 19456 {
|
||||
vars.ImageSquare18KList = append(vars.ImageSquare18KList, currentImagePath)
|
||||
} else if width < 20480 {
|
||||
vars.ImageSquare19KList = append(vars.ImageSquare19KList, currentImagePath)
|
||||
} else if width >= 20480 {
|
||||
vars.ImageSquareHKList = append(vars.ImageSquareHKList, currentImagePath)
|
||||
}
|
||||
}
|
||||
@@ -400,6 +460,56 @@ func moveHorizontalImage(pickerDir string) {
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageHorizontal9KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageHorizontal10KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_横屏_10K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageHorizontal10KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageHorizontal11KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_横屏_11K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageHorizontal11KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageHorizontal12KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_横屏_12K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageHorizontal12KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageHorizontal13KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_横屏_13K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageHorizontal13KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageHorizontal14KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_横屏_14K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageHorizontal14KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageHorizontal15KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_横屏_15K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageHorizontal15KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageHorizontal16KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_横屏_16K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageHorizontal16KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageHorizontal17KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_横屏_17K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageHorizontal17KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageHorizontal18KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_横屏_18K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageHorizontal18KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageHorizontal19KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_横屏_19K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageHorizontal19KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageHorizontalHKList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_横屏_原图"
|
||||
util.CreateDir(imageDirPath)
|
||||
@@ -461,6 +571,56 @@ func moveVerticalImage(pickerDir string) {
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageVertical9KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageVertical10KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_竖屏_10K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageVertical10KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageVertical11KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_竖屏_11K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageVertical11KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageVertical12KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_竖屏_12K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageVertical12KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageVertical13KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_竖屏_13K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageVertical13KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageVertical14KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_竖屏_14K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageVertical14KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageVertical15KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_竖屏_15K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageVertical15KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageVertical16KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_竖屏_16K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageVertical16KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageVertical17KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_竖屏_17K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageVertical17KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageVertical18KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_竖屏_18K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageVertical18KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageVertical19KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_竖屏_19K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageVertical19KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageVerticalHKList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_竖屏_原图"
|
||||
util.CreateDir(imageDirPath)
|
||||
@@ -522,6 +682,56 @@ func moveSquareImage(pickerDir string) {
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageSquare9KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageSquare10KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_等比_10K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageSquare10KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageSquare11KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_等比_11K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageSquare11KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageSquare12KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_等比_12K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageSquare12KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageSquare13KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_等比_13K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageSquare13KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageSquare14KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_等比_14K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageSquare14KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageSquare15KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_等比_15K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageSquare15KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageSquare16KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_等比_16K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageSquare16KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageSquare17KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_等比_17K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageSquare17KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageSquare18KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_等比_18K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageSquare18KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageSquare19KList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_等比_19K"
|
||||
util.CreateDir(imageDirPath)
|
||||
util.DoMoveFileToDir(vars.ImageSquare19KList, imageDirPath)
|
||||
}
|
||||
if len(vars.ImageSquareHKList) > 0 {
|
||||
imageDirPath := pickerDir + pathSeparator + "图片_等比_原图"
|
||||
util.CreateDir(imageDirPath)
|
||||
|
||||
Reference in New Issue
Block a user