Page 1 of 1

Batch file problems on XP with conert and composite

Posted: 2010-05-27T12:15:02-07:00
by peterpan33
Hello hello,
i have a problem with a batch file. I want to convert and composite pictures from my directory with the batch file. So all pics are composite with the 123.gif! On WIN7 everything is fine, but on Win XP it is a problem and it does´n work. The code is:

Code: Select all

SET "TEST=C:\TEST\123.gif"
FOR /f "delims=" %%I IN ('DIR *.JPG /b') DO (convert "%TEST%" ^( "%%I" -resize 1170x878 ^) -geometry +610+115 -composite newpic\%date%_"%mytime%"_"%%I")
And does some knows why the image 123.gif can not be a 123.jpg? If it is a JPG the result pics will be dark.
Sorry for my englisch and thanks for help.
Peter

Re: Batch file problems on XP with conert and composite

Posted: 2010-05-27T12:57:02-07:00
by snibgo
Windows XP doesn't like filenames with slash (/). %date% probably contains slashes.

The quotes in SET "TEST=C:\TEST\123.gif" don't make sense (but they seem harmless).

FOR /f "delims=" %%I IN ('DIR *.JPG /b')
could be
FOR %%I IN (*.JPG)

I don't know why 123.jpg might be a problem. What version IM do you use? Please post 123.gif, 123.jpg and one of the jpg files that creates the problem.

Re: Batch file problems on XP with conert and composite

Posted: 2010-05-28T00:28:14-07:00
by peterpan33
Hello,
thanks for your fast help. My %date% isn´t with a slash. It is like: 28.05.2010.
I will try my file without the quotes in set...
Could it be that the quotes in:

Code: Select all

FOR /f "delims=" %%I IN ('DIR *.JPG /b') DO (convert "%TEST%" ^( "%%I" -resize 1170x878 ^) -geometry +610+115 -composite newpic\%date%_"%mytime%"_"%%I")
make problems. I made the quotes to convert/composite pics with a blank or a not regular sign like $%& in the filename.
I use ImageMagick-6.6.1-4-Q8-windows-dll on my computer. I will check my files!!!
Thanks
Peter

Re: Batch file problems on XP with conert and composite

Posted: 2010-05-28T09:18:37-07:00
by snibgo
You shouldn't need quotes inside filenames, so
newpic\%date%_"%mytime%"_"%%I"
should be:
"newpic\%date%_%mytime%_%%I"


Start simple, and build up until it doesn't work, to isolate the problem, such as:

convert C:\TEST\123.gif ( abc.JPG -resize 1170x878 ) -geometry +610+115 -composite newpic\28.05.2010_10.34.12_abc.JPG