Thanks to this forum I've assembled a script with snips of scripts left and right.
I'm using ImageMagick-6.8.9-Q16 in a Windows 7 environment.
The script produce 3 pictures one with a Logo, one with text and one with both.
The problem is that the intended "©" becomes a "®" on the picture.
I have read here:
- viewtopic.php?f=1&t=10356&p=32586&hilit ... ows#p32586
http://www.imagemagick.org/Usage/text/
http://www.imagemagick.org/Usage/window ... r_encoding
Does anybody can help me?
Kind Regards
Guy
Code: Select all
::@echo on
set originale=D:\Org-jpg-logo-IN\
set converted=\\dgcmdc002\dalet\To-JPGHIRES-Logo\
set logo=C:\Program Files\ImageMagick-6.8.9-Q16\logo-full.png
set programpath=C:\Program Files\ImageMagick-6.8.9-Q16\
for %%f in (%originale%*.jpg) do call :process %%~nxf
goto :eof
:process
SET filename=%1 %2 %3 %4 %5 %6
Set file=%originale%%filename%
FOR /F %%x IN ('identify -ping -format "%%w" "%file%"') DO SET width=%%x
FOR /F %%x IN ('identify -ping -format "%%h" "%file%"') DO SET hight=%%x
::For /F %%x IN ('identify -format "\n%%[EXIF:copyright]" "%file%"') DO SET Author="Author"+%%x
FOR /F "tokens=*" %%x IN ('identify -format "\n%%[EXIF:Artist]" "%file%"') DO SET Artist=%%x
set /a dimension=width*hight
echo file %file% >> %converted%\percent.txt
echo width %width% >> %converted%\percent.txt
echo hight %hight% >> %converted%\percent.txt
echo artist %artist% >> %converted%\percent.txt
set /a widthpercent=(width/7)
set /a hightpercent=(hight/7)
if %widthpercent% GTR %hightpercent% set /a percent=widthpercent
if %hightpercent% GEQ %widthpercent% set /a percent=hightpercent
echo widthpercent %widthpercent% >> %converted%\percent.txt
echo hightpercent %hightpercent% >> %converted%\percent.txt
echo percent %percent% >> %converted%\percent.txt
echo %1 >> %converted%\percent.txt
echo %2 >> %converted%\percent.txt
echo %3 >> %converted%\percent.txt
echo %4 >> %converted%\percent.txt
echo %5 >> %converted%\percent.txt
::"C:\Program Files\ImageMagick-6.8.9-Q16\convert.exe" "%logo%" -resize %percent%x%percent% logo-tmp.png
::"C:\Program Files\ImageMagick-6.8.9-Q16\convert.exe" "%logo%" -resize %percent% "%converted%\%logo%"
"%programpath%convert.exe" "%logo%" -resize %percent%x%percent% %converted%\logo-tmp.png
::"%programpath%composite.exe" "%converted%logo-tmp.png" "%file%" -dissolve 55 -gravity SouthEast "%converted%\%filename%"
"%programpath%composite.exe" "%converted%logo-tmp.png" "%file%" -dissolve 55 -gravity SouthEast "%converted%\%1-55.jpg"
"%programpath%convert.exe" "%file%" -pointsize 100 -fill black -gravity southwest -annotate +0+0 "U+000A9%Artist%" ^
:: -fill white -gravity southwest -annotate +10+10 "©%Artist%" "%converted%\Wat2%filename%"
::"%programpath%convert.exe" "%file%" -pointsize 100 -fill black -gravity southwest -annotate +0+0 " BE Defence DGCCOM %Artist%" ^
:: -fill white -gravity southwest -annotate +10+10 " DGCCOM %Artist%" "%converted%\Wat3%filename%"
del "%originale%%filename%"
del "%converted%\logo-tmp.png"