Hello,
can someone help me about how I can use an -set option:variable_name later in same command?
Ex:
convert x.jpg -trim -set option:trim_value "%@" -delete 0 y.jpg -crop "%[trim_value]" +repage y1.jpg
Nothing happen. I verified and the [trim_value] contain the correct value of trim.
Thank you.
About set option
-
- Posts: 24
- Joined: 2012-01-10T05:19:23-07:00
- Authentication code: 8675308
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: About set option
"-crop" can't take an expression. Its argument must be of the form WxH+X+Y.
snibgo's IM pages: im.snibgo.com
-
- Posts: 24
- Joined: 2012-01-10T05:19:23-07:00
- Authentication code: 8675308
Re: About set option
Thank you, I just saw my mistake:
Now the correct comand is
convert x.jpg -set option:trim_value "%@" -delete 0 y.jpg -crop "%[trim_value]" +repage y1.jpg
The trim value have form WxH+X+Y., but it seems that crop don't want to use it. Another alternatifs?
Now the correct comand is
convert x.jpg -set option:trim_value "%@" -delete 0 y.jpg -crop "%[trim_value]" +repage y1.jpg
The trim value have form WxH+X+Y., but it seems that crop don't want to use it. Another alternatifs?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: About set option
It can't be an expression. It must be a literal.
You could do this as two commands in your shell. The first gets the value of "-format %@", the second uses this to crop the other image.
You could do this as two commands in your shell. The first gets the value of "-format %@", the second uses this to crop the other image.
snibgo's IM pages: im.snibgo.com
-
- Posts: 24
- Joined: 2012-01-10T05:19:23-07:00
- Authentication code: 8675308
Re: About set option
I know that but my intention was to do on a single command.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: About set option
Perhaps it can be done in one command with "-distort" and a viewport.
snibgo's IM pages: im.snibgo.com
-
- Posts: 24
- Joined: 2012-01-10T05:19:23-07:00
- Authentication code: 8675308
Re: About set option
Right now I found that and I think is the solution. Thank you very much.