Skip to content

Commit 522b773

Browse files
committed
...
1 parent 1947edb commit 522b773

2 files changed

Lines changed: 602 additions & 0 deletions

File tree

template/Folder Horizontal.bat

Lines changed: 298 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,298 @@
1+
:: Template-Version=v1.0
2+
3+
:: Template Info
4+
::========================================================
5+
::` Image template by 90scomics.com
6+
::` Convert and edit using ImageMagick.
7+
::` ------------------------------------------------------
8+
9+
10+
:: Template Config
11+
::========================================================
12+
::--------- Label --------------------------
13+
set "display-FolderName=yes"
14+
set "FolderNameShort-characters-limit=11"
15+
set "FolderNameLong-characters-limit=36"
16+
set "FolderName-Center=Auto"
17+
18+
::--------- Movie Info ---------------------
19+
set "display-movieinfo=yes"
20+
set "show-Rating=yes"
21+
set "show-Genre=yes"
22+
set "genre-characters-limit=32"
23+
24+
::--------- Additional Art -----------------
25+
set "use-Logo-instead-FolderName=no"
26+
set "display-clearArt=yes"
27+
::========================================================
28+
29+
30+
:: Images Source
31+
::========================================================
32+
set "folderhorizontal-top=%rcfi%\img\folderhorizontal-top.png"
33+
set "folderhorizontal-topfx=%rcfi%\img\folderhorizontal-topfx.png"
34+
set "folderhorizontal-topshadow=%rcfi%\img\folderhorizontal-topshadow.png"
35+
set "folderhorizontal-main=%rcfi%\img\folderhorizontal-main.png"
36+
set "folderhorizontal-mainfx=%rcfi%\img\folderhorizontal-mainfx.png"
37+
set "star-image=%rcfi%\img\star.png"
38+
set "background-image=%rcfi%\img\- background.png"
39+
::========================================================
40+
41+
setlocal
42+
call :LAYER-BASE
43+
call :LAYER-RATING
44+
call :LAYER-GENRE
45+
call :LAYER-LOGO
46+
call :LAYER-CLEARART
47+
call :LAYER-FOLDER_NAME
48+
"%Converter%" ^
49+
%CODE-BACKGROUND% ^
50+
%CODE-POSTER-TOP% ^
51+
%CODE-FOLDER-NAME-SHORT% ^
52+
%CODE-FOLDER-NAME-LONG% ^
53+
%CODE-LOGO-IMAGE% ^
54+
%CODE-CLEARART-IMAGE% ^
55+
%CODE-POSTER-TOP-SHADOW% ^
56+
%CODE-POSTER-MAIN% ^
57+
%CODE-STAR-IMAGE% ^
58+
%CODE-RATING% ^
59+
%CODE-GENRE% ^
60+
%CODE-ICON-SIZE% ^
61+
"%OutputFile%"
62+
endlocal
63+
exit /b
64+
65+
66+
67+
::::::::::::::::::::::::::: CODE START :::::::::::::::::::::::::::::::::
68+
69+
:LAYER-BASE
70+
set CODE-BACKGROUND= ( "%background-image%" ^
71+
-scale 512x512! ^
72+
-background none ^
73+
-extent 512x512 ^
74+
) -compose Over
75+
76+
set CODE-POSTER-MAIN= ( ^
77+
"%inputfile%" ^
78+
-scale 495x307! ^
79+
-gravity Northwest ^
80+
-geometry +8+141 ^
81+
"%folderhorizontal-main%" ) -compose over -composite ^
82+
( "%folderhorizontal-mainfx%" -scale 512x512! ) -compose over -composite
83+
84+
set CODE-POSTER-TOP= ( ^
85+
"%inputfile%" ^
86+
-scale 512x512! ^
87+
-blur 0x19 ^
88+
"%folderhorizontal-TOP%" ) -compose over -composite ^
89+
( "%folderhorizontal-TOPfx%" -scale 512x512! ) -compose over -composite
90+
91+
set CODE-POSTER-TOP-SHADOW= ( "%folderhorizontal-TOPshadow%" -scale 512x512! ) -compose over -composite
92+
set CODE-ICON-SIZE=-define icon:auto-resize="%TemplateIconSize%"
93+
exit /b
94+
95+
:LAYER-RATING
96+
if /i not "%display-movieinfo%" EQU "yes" exit /b
97+
if /i not "%Show-Rating%" EQU "yes" exit /b
98+
call :GetInfo-nfo_file
99+
if not defined rating exit /b
100+
101+
set CODE-STAR-IMAGE= ( ^
102+
"%star-image%" ^
103+
-scale 88x88! ^
104+
-gravity Northwest ^
105+
-geometry +0+356 ^
106+
( +clone -background BLACK% ^
107+
-shadow 40x1.2+1.8+3 ) ^
108+
+swap -background none -layers merge -extent 512x512 ^
109+
) -compose Over -composite
110+
111+
set CODE-RATING= ( ^
112+
-font "%rcfi%\resources\ANGIE-BOLD.TTF" ^
113+
-fill rgba(0,0,0,0.9) ^
114+
-density 400 ^
115+
-pointsize 6 ^
116+
-kerning 0 ^
117+
label:"%rating%" ^
118+
-gravity Northwest ^
119+
-geometry +13+383 ^
120+
( +clone -background ORANGE -shadow 30x1.2+2+2 ) +swap -background none -layers merge ^
121+
( +clone -background YELLOW -shadow 30x1.2-2-2 ) +swap -background none -layers merge ^
122+
( +clone -background ORANGE -shadow 30x1.2-2+2 ) +swap -background none -layers merge ^
123+
( +clone -background ORANGE -shadow 30x1.2+2-2 ) +swap -background none -layers merge ^
124+
) -compose Over -composite
125+
exit /b
126+
127+
:LAYER-GENRE
128+
if /i not "%display-movieinfo%" EQU "yes" exit /b
129+
if /i not "%Show-Genre%" EQU "yes" exit /b
130+
if not defined genre exit /b
131+
132+
set CODE-GENRE= ( ^
133+
-font "%rcfi%\resources\ANGIE-BOLD.TTF" ^
134+
-fill BLACK ^
135+
-density 400 ^
136+
-pointsize 5 ^
137+
-kerning 0 ^
138+
-gravity Northwest ^
139+
-geometry +79+400 ^
140+
label:"%genre%" ^
141+
( +clone -background ORANGE -shadow 70x1.2+2.6+2.6 ) +swap -background none -layers merge ^
142+
( +clone -background YELLOW -shadow 70x1.2-2.6-2.6 ) +swap -background none -layers merge ^
143+
( +clone -background ORANGE -shadow 70x1.2-2.6+2.6 ) +swap -background none -layers merge ^
144+
( +clone -background ORANGE -shadow 70x1.2+2.6-2.6 ) +swap -background none -layers merge ^
145+
( +clone -background BLACK -shadow 0x0.2+4+5 ) +swap -background none -layers merge ^
146+
) -composite
147+
exit /b
148+
149+
:LAYER-LOGO
150+
if /i not "%use-Logo-instead-folderName%"=="yes" exit /b
151+
152+
if exist "*logo.png" (
153+
for %%D in (*logo.png) do set "logo=%%~fD"
154+
) else exit /b
155+
156+
set CODE-LOGO-IMAGE= ( "%Logo%" ^
157+
-scale 160x55! ^
158+
-background none ^
159+
-gravity Northwest ^
160+
-geometry +51+86 ^
161+
) -compose Over -composite
162+
exit /b
163+
164+
:LAYER-CLEARART
165+
if /i not "%display-clearArt%"=="yes" exit /b
166+
167+
if exist "*clearart.png" (
168+
for %%D in (*clearart.png) do set "clearart=%%~fD"
169+
) else exit /b
170+
171+
set CODE-CLEARART-IMAGE= ( "%clearart%" ^
172+
-scale 248x ^
173+
-background none ^
174+
-gravity Northwest ^
175+
-geometry +223+3 ^
176+
) -compose Over -composite
177+
exit /b
178+
179+
180+
:LAYER-FOLDER_NAME
181+
if /i not "%display-FolderName%"=="yes" exit /b
182+
if defined CODE-LOGO-IMAGE exit /b
183+
184+
for %%F in ("%cd%") do set "foldername=%%~nxF"
185+
set "FolNamShort=%foldername%"
186+
set "FolNamShortLimit=%FolderNameShort-characters-limit%"
187+
set /a "FolNamShortLimit=%FolNamShortLimit%+1"
188+
set "FolNamLong=%foldername%"
189+
set "FolNamLongLimit=%FolderNameLong-characters-limit%"
190+
set /a "FolNamLongLimit=%FolNamLongLimit%+1"
191+
192+
:GetInfo-FolderName-Short
193+
set /a FolNamShortCount+=1
194+
if not "%_FolNamShort%"=="%FolderName%" (
195+
call set "_FolNamShort=%%FolderName:~0,%FolNamShortCount%%%"
196+
goto GetInfo-FolderName-Short
197+
)
198+
set /A "FolNamShortLimiter=%FolNamShortLimit%-4"
199+
if %FolNamShortCount% GTR %FolNamShortLimit% call set "FolNamShort=%%FolderName:~0,%FolNamShortLimiter%%%..."
200+
201+
202+
set "FolNamCenter=-gravity center -geometry -122-152"
203+
set "FolNamLeft=-gravity Northwest -geometry +17+44"
204+
if %FolNamShortCount% LEQ %FolNamShortLimiter% (set "FolNamPos=%FolNamLeft%") else (set "FolNamPos=%FolNamCenter%")
205+
if /i "%FolderName-Center%"=="yes" set "FolNamPos=%FolNamCenter%"
206+
if /i "%FolderName-Center%"=="no" set "FolNamPos=%FolNamLeft%"
207+
208+
:GetInfo-FolderName-Long
209+
set /a FolNamLongCount+=1
210+
if not "%_FolNamLong%"=="%FolderName%" (
211+
call set "_FolNamLong=%%FolderName:~0,%FolNamLongCount%%%"
212+
goto GetInfo-FolderName-Long
213+
)
214+
set /A "FolNamLongLimiter=%FolNamLongLimit%-4"
215+
if %FolNamLongCount% GTR %FolNamLongLimit% call set "FolNamLong=%%FolderName:~0,%FolNamLongLimiter%%%..."
216+
217+
set CODE-FOLDER-NAME-SHORT= ^
218+
( ^
219+
-font Arial-Bold ^
220+
-fill rgba(255,255,255,0.9) ^
221+
-density 400 ^
222+
-pointsize 5.2 ^
223+
%FolNamPos% ^
224+
-background none ^
225+
label:"%FolNamShort%" ^
226+
( +clone -background BLACK -shadow 10x5+0.6+0.6 ) +swap -background none -layers merge ^
227+
( +clone -background BLACK -shadow 10x5-0.6-0.6 ) +swap -background none -layers merge ^
228+
( +clone -background BLACK -shadow 10x5-0.6+0.6 ) +swap -background none -layers merge ^
229+
( +clone -background BLACK -shadow 10x5+0.6-0.6 ) +swap -background none -layers merge ^
230+
) -composite
231+
232+
if %FolNamShortCount% LEQ %FolNamShortLimit% exit /b
233+
234+
set CODE-FOLDER-NAME-LONG= ^
235+
( ^
236+
-font Arial-Bold ^
237+
-fill white ^
238+
-density 400 ^
239+
-pointsize 3.5 ^
240+
-kerning 2 ^
241+
-gravity Northwest ^
242+
-geometry -10+78 ^
243+
label:"%FolNamLong%" ^
244+
( +clone -background BLACK -shadow 10x5+0.2+0.2 ) +swap -background none -layers merge ^
245+
( +clone -background BLACK -shadow 10x5-0.2-0.2 ) +swap -background none -layers merge ^
246+
( +clone -background BLACK -shadow 10x5-0.2+0.2 ) +swap -background none -layers merge ^
247+
( +clone -background BLACK -shadow 10x5+0.2-0.2 ) +swap -background none -layers merge ^
248+
) -composite
249+
exit /b
250+
251+
252+
:GetInfo-nfo_file
253+
if not exist "*.nfo" (
254+
rem echo %TAB% %g_%No ".nfo" detected.%r_%
255+
exit /b
256+
)
257+
258+
for %%N in (*.nfo) do (
259+
set "nfoName=%%~nxN"
260+
for /f "usebackq tokens=1,2,3,4 delims=<>" %%C in ("%%N") do (
261+
if /i not "%%D"=="" (
262+
if /i not "%%D"=="genre" (set "%%D=%%E") else (
263+
set "genre=%%E"
264+
call :GetInfo-Collect
265+
)
266+
)
267+
)
268+
)
269+
270+
if defined value (
271+
set "rating=%value:~0,3%"
272+
) else echo %TAB%%r_%%i_% %_%%g_% Error: No rating value provided in "%nfoName%"%r_%
273+
274+
if not defined genre (
275+
echo %TAB%%r_%%i_% %_%%g_% Error: No genre provided in "%nfoName%"%r_%
276+
exit /b
277+
)
278+
set "genre=__%_genre%"
279+
set "genre=%genre:__, =%"
280+
set "genre=%genre:Science Fiction=SciFi%"
281+
set "GenreLimit=%genre-characters-limit%"
282+
set /a "GenreLimit=%GenreLimit%+1"
283+
284+
:GetInfo-Genre
285+
set /a GenreCount+=1
286+
if not "%_genre%"=="%genre%" (
287+
call set "_genre=%%genre:~0,%GenreCount%%%"
288+
goto GetInfo-Genre
289+
)
290+
set /A "GenreLimiter=%GenreLimit%-4"
291+
if %GenreCount% GTR %GenreLimit% call set "genre=%%genre:~0,%GenreLimiter%%%..."
292+
exit /b
293+
294+
:GetInfo-Collect
295+
set "_genre=%_genre%, %genre%"
296+
exit /b
297+
298+
::::::::::::::::::::::::::: CODE END ::::::::::::::::::::::::::::::::::

0 commit comments

Comments
 (0)