2 rem Script to diff SVG images visually (as PNG) in TortoiseGit client
4 rem It assumes that Inkscape and TortoiseGitIDiff executables are either
5 rem installed in default locations in Program Files, or are accessible by PATH
7 rem To use this script for diffing SVG images, open TortoiseGit settings
8 rem (Start -> Programs -> TortoiseGit -> Settings), select "Diff Viewer",
9 rem click button "Advanced..." on the right tab and then add new record:
11 rem - External program: <path to OCCT>\adm\svgdiff.bat %base %mine %bname %yname
13 rem Remove double quotes around arguments
16 set "f1=%f1:~1,-1%.png"
17 set "f2=%f2:~1,-1%.png"
19 rem Check if Inkscape and TortoiseGit are installed in default locations in
20 rem ProgramFiles; if not, assume they still may be accessible by PATH
21 set "inkscape=%ProgramFiles%\Inkscape\inkscape.exe"
22 if not exist "%inkscape%" set inkscape=inkscape.exe
23 set "tgitidiff=%ProgramFiles%\TortoiseGit\bin\TortoiseGitIDiff.exe"
24 if not exist "%tgitidiff%" set tgitidiff=TortoiseGitIDiff.exe
26 rem Convert SVG to PNG using Inkscape
27 "%inkscape%" -e "%f1%" %1
28 "%inkscape%" -e "%f2%" %2
30 rem Call Tortoise differ
31 "%tgitidiff%" /left:"%f1%" /right:"%f2%" /lefttitle:%3 /righttitle:%4