Page 2 of 2

Re: Combine/Stack image files

Posted: 2014-03-11T03:06:45-07:00
by snibgo
If you have spaces in your directory or filenames, you should quote the second %D, eg:

Code: Select all

for /R \mydir\images %D in (*.jpg) do identify "%D"
If that doesn't help, please copy and paste the exact command and error message here. Also, what version of IM are you running? "convert -version".

Re: Combine/Stack image files

Posted: 2014-03-12T20:09:04-07:00
by Axelotl
Oh yeah using the quote worked perfectly.

Version: ImageMagick 6.8.8-7 Q16 x64 2014-02-13
Features: DPC Modules OpenMP

How do I -append all the images though?

Re: Combine/Stack image files

Posted: 2014-03-12T21:30:47-07:00
by snibgo
I don't know exactly what you are trying to do, or what is giving you problems. Perhaps you want something like:

Code: Select all

for /R . %D in (1.*) do (cd %~dpD & %IM%convert *.jpg -append x.png)
If you need help with Windows commands, I suggest you find a suitable forum.

Re: Combine/Stack image files

Posted: 2014-03-13T02:15:15-07:00
by Axelotl
All I'm trying to do is -append images together.

To be very specific I have a directory with a few hundred other directories (2014-03-09 00-52-11, 2014-03-09 00-53-31, etc).
Every one of these sub-directories have different images inside them named "image.jpeg, image_001.jpeg, image_002.jpeg and image_003.jpeg".
I want an appended image to be produced for each set of images in each folder so that by the end each folder will have an appended .jpeg.
I already know how to do it with one folder at a time (using the simple convert -append command).

I did say I was new to this and I've tried to many times but with no success.

I tried that code in a few different ways but I'm not sure if I'm applying it wrong or it isn't what I'm looking for.

Re: Combine/Stack image files

Posted: 2014-03-13T09:32:06-07:00
by snibgo
The command could be something like:

Code: Select all

for /R \your\root\directory %D in (image.*) do (cd %~dpD & %IM%convert image.jpeg image_001.jpeg image_002.jpeg image_003.jpeg -append appended.jpeg)

Re: Combine/Stack image files

Posted: 2014-03-13T10:19:54-07:00
by fmw42
For new users who want to do scripting in Windows bat files, I found a few referenced that might provide useful for learning.

http://www.microsoft.com/resources/docu ... x?mfr=true
http://en.wikibooks.org/wiki/Windows_Batch_Scripting
http://www.wikihow.com/Use-the-Microsof ... e-Language

Re: Combine/Stack image files

Posted: 2014-03-15T03:11:15-07:00
by Axelotl
The code above just asks "More?"

Can you test it?

Re: Combine/Stack image files

Posted: 2014-03-15T06:38:22-07:00
by snibgo
I did. The command I gave, pasted into a command window, works for me (with a different directory name).

Re: Combine/Stack image files

Posted: 2014-03-15T19:42:57-07:00
by Axelotl
Gah this is frustrating.

Here's a screenshot:

http://s11.postimg.org/w6inwxbya/screem.jpg

Bottom right is the command I used, left if the result and the rest are the directories and images.

What am I doing wrong?

Re: Combine/Stack image files

Posted: 2014-03-15T20:06:51-07:00
by snibgo
As you can see, you are not even running convert.

%IM% is the drive\directory of convert.exe. Most users choose the option at installation to put this in their system path. I don't because I need to run different versions of IM for different purposes. I should remove "%IM%" from code I put here, but I often forget. If you don't have %IM% defined, then keeping it in is harmless.

Try the following command:

Code: Select all

convert logo: x.jpeg
If this fails, then anything more complex will also fail, and I suggest you reinstall IM choosing to put the location in your system path.

Re: Combine/Stack image files

Posted: 2014-03-15T23:44:22-07:00
by Axelotl
No way it finally worked! Thank you so much for sticking around for this long haha.

The exact code I ran was:

Code: Select all

for /R %D in (*.*) do (cd %~dpD & convert image.jpeg image_001.jpeg image_002.jpeg image_003.jpeg -append appended.jpeg
Relief.