hi,
i'm Sven and my first post here.
(Sorry for my bad English, I am from German)
For weeks now I'm fighting with little problem and can not find a solution
together with "append" I put thousands of images in batch
code:
convert %xeins%.jpg %xzwei%.jpg -append C:\pics\%number%.jpg
But, I do not create If query to "identify-format" so that for example in portrait or landscape mode -append or +appened is selected
e.g -->
if height > with then
convert %xeins%.jpg %xzwei%.jpg -append C:\pics\%number%.jpg
else
convert %xeins%.jpg %xzwei%.jpg +append C:\pics\%number%.jpg
fi
.............
I have Windows Vista and i will make a .bat file for this script
It would be very happy if I could help some one!
many greetings from Germany
Sven
Problem with identify -format -append
- GreenKoopa
- Posts: 457
- Joined: 2010-11-04T17:24:08-07:00
- Authentication code: 8675308
Re: Problem with identify -format -append
If I understand, this is the part you need help with?
identify -format "%[fx:h>w]" image.jpg
identify -format "%%[fx:h>w]" image.jpg --- (% escaped for inside batch file)
You are appending two images. The if condition will look at one image or both?
Does this help?blitzmailer wrote: if height > with then
identify -format "%[fx:h>w]" image.jpg
identify -format "%%[fx:h>w]" image.jpg --- (% escaped for inside batch file)
You are appending two images. The if condition will look at one image or both?
Re: Problem with identify -format -append
hi Green,GreenKoopa wrote:If I understand, this is the part you need help with?Does this help?blitzmailer wrote: if height > with then
identify -format "%[fx:h>w]" image.jpg
identify -format "%%[fx:h>w]" image.jpg --- (% escaped for inside batch file)
You are appending two images. The if condition will look at one image or both?
thanks for your fast answer!
But still i do not understand how I can get the value of "identify" in an if and else query
e.g.
Set with = identify -format "%%[fx:h>w]" image.jpg
Set high = identify -format "%%[fx:h>w]" image.jpg
if with > high then
work-a
else
work-b
fi
........Greeting sven
- GreenKoopa
- Posts: 457
- Joined: 2010-11-04T17:24:08-07:00
- Authentication code: 8675308
Re: Problem with identify -format -append
I was asking if my identify gave you the boolean output you needed. It compares height > width using the -fx operator. Try running it on an image.blitzmailer wrote: But still i do not understand how I can get the value of "identify" in an if and else query
So I was intending it to be more like:blitzmailer wrote: Set with = identify -format "%%[fx:h>w]" image.jpg
Set high = identify -format "%%[fx:h>w]" image.jpg
Set answer = identify -format "%%[fx:h>w]" image.jpg
if answer then
...
However, I believe Windows batch files don't allow you to capture a program's output that easily. This is currently driving me crazy and so I am moving away from .bat scripts. I believe it can be done. One method uses a FOR loop. Many places on the web give examples of this, including in ImageMagick's Usage Examples:
http://www.imagemagick.org/Usage/windows/#output
You might also be able to use Set /p and use redirection to capture the output.