1/ I want to scale the text but can only use whole numbers.
2/ For some reason I can not use a dynamic filename.
Can anyone point me in the correct direction to sort these problems ?
Code: Select all
:: Resize the photo and add the border to the larger version - save both versions ( one is a tempory file )
convert.exe %1 ( +clone -thumbnail 600x600 -strip -bordercolor Black -border 2x2 -write "temp.png" +delete ) -thumbnail 150x150 -strip -unsharp 1.5x1+0.7+0.02 -quality 80 thumb.jpg "th_%~n1.jpg"
:: Get the temp image width and height and set the variables
FOR /F %%x IN ('identify -ping -format "%%w" temp.png') DO SET w=%%x
FOR /F %%x IN ('identify -ping -format "%%h" temp.png') DO SET h=%%x
:: Scale the watermark image - NOT WORKING AS NUMBER MUST BE A WHOLE NUMBER!
::SET/A w1=%w%x0.9
::SET/A h1=%h%x0.2
:: Create the watermark text
convert.exe -size %w%x%h% -background none -font Utopia-bold -fill white -gravity center caption:"Copyright of Anthony" -shade 240x40 "font.png"
:: Composite the watermark onto the image - IF I USE A NAME LIKE embossed.jpg THIS WORKS BUT "norm_%~n1.jpg" FAILS
composite -watermark 15% -gravity center font.png temp.png embossed.jpg
:: Tidy up - Could be left as it will be overwritten by the next image
del font.png
del temp.png