Last active
January 18, 2021 15:18
-
-
Save bumaociyuan/d80cf2a80483245aa961189b2f1b66c0 to your computer and use it in GitHub Desktop.
需要 https://www.imagemagick.org/script/binary-releases.php#windows 把拼图.bat 放到 C:\Users\zx\AppData\Roaming\Microsoft\Windows\SendTo\ 里面就可以用右键 发送到 拼图.bat 调用脚本
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
title Concat images vertically | |
echo Begin | |
set datetimef=%date:~0,2%-%date:~3,2%_%time:~0,2%-%time:~3,2%-%time:~6,2% | |
echo %datetimef% | |
setlocal enabledelayedexpansion | |
set argCount=0 | |
for %%x in (%*) do ( | |
set /A argCount+=1 | |
set "argVec[!argCount!]=%%~x" | |
) | |
echo Number of processed arguments: %argCount% | |
for /L %%i in (1,1,%argCount%) do echo "!argVec[%%i]!" >> tmp.txt | |
sort tmp.txt /o p.txt | |
for /F "tokens=*" %%A in (p.txt) do @magick convert -mattecolor white -smush 15 -append -resize 900 concat-%datetimef%.jpg %%A concat-%datetimef%.jpg | |
del tmp.txt | |
del p.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
title Concat images vertically | |
echo Begin | |
for /f "tokens=1-3 delims=: " %%i in ("%time%") do ( | |
set hh=%%i | |
set mm=%%j | |
set ss=%%k | |
) | |
for /f "tokens=1-4 delims=/ " %%i in ("%date%") do ( | |
set dow=%%i | |
set month=%%j | |
set day=%%k | |
set year=%%l | |
) | |
set datetimef==%month%_%day%_%year%_%hh%_%mm%_%ss% | |
echo datetimef= is %datetimef=% | |
setlocal enabledelayedexpansion | |
set argCount=0 | |
for %%x in (%*) do ( | |
set /A argCount+=1 | |
set "argVec[!argCount!]=%%~x" | |
) | |
echo Number of processed arguments: %argCount% | |
for /L %%i in (1,1,%argCount%) do echo "!argVec[%%i]!" >> tmp.txt | |
sort tmp.txt /o p.txt | |
for /F "tokens=*" %%A in (p.txt) do @magick convert -mattecolor white -smush 15 -append -resize 900 concat-%datetimef%.jpg %%A concat-%datetimef%.jpg | |
del tmp.txt | |
del p.txt |
拼图2.bat 优化了时间获取方法
有些系统用 拼图.bat 获取的时间有 斜杆,会导致脚本失败
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
直接在地址栏输入
shell:sendto
就能打开 sendto folder
https://imagemagick.org/download/binaries/ImageMagick-7.0.8-56-Q16-x64-dll.exe