Skip to content

Instantly share code, notes, and snippets.

@bumaociyuan
Last active January 18, 2021 15:18
Show Gist options
  • Save bumaociyuan/d80cf2a80483245aa961189b2f1b66c0 to your computer and use it in GitHub Desktop.
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 调用脚本
@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
@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
@bumaociyuan
Copy link
Author

HEIC 转 jpeg
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment