Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
@echo off
title = gif watermarking tool
goto :start
:start
SET FIRST=C:\Users\fff\Desktop\gifs
SET SECOND=C:\Users\fff\Desktop\gifs2
for /F "usebackq" %%F in (`dir /b %FIRST%\*.gif`) do (magick convert %%F -coalesce -gravity SouthEast -geometry +0+0 null: watermark.png -layers composite -layers optimize %SECOND%\%%~nxF)
pause
I wrote this code and got an error :
convert: unable to open image 'giphy.gif': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: unable to open image 'watermark.png': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: unable to open file `watermark.png' @ error/png.c/ReadPNGImage/3978.
convert: missing Null Image List Separator layers Composite @ error/mogrify.c/MogrifyImageList/8428.
jojocague wrote:Anyone know how I can resolve this problem?
Your "dir /b" command returns the file names of the contents of the "%FIRST%" directory, but doesn't include the directory name itself. That makes the "convert" command look for those file names in the current directory, and of course it can't find them. You could use "pushd" to change to the directory "%FIRST%" before the "for" loop, then "popd" to change back to the current directory when the command is finished. I haven't tested it, but something like this should get you closer...