Page 1 of 1

Unable to 'set' the total number of images!

Posted: 2009-06-11T19:18:51-07:00
by anthony
I am unable to get the correct number of images present in the current image sequence using a -set option

Code: Select all

convert -size 100x20 xc: xc: xc: xc: xc: xc: xc: \
         -set label '%s/%n (%[scenes]) - %[fx:t]/%[fx:n]' \
        -gravity center -annotate 0 '%l' -append show:
In the resulting image the output values for %n, %[scenes], and %[fx:n], is 1 even though the actual number of images present in the current image sequence is obviously more than 1

The more important element is the FX one as I want to adjust composite method args based on the result of a FX expression :-)

Re: Unable to 'set' the total number of images!

Posted: 2009-06-11T21:05:06-07:00
by magick
Images are removed one at a time from the image stack and any pending options are applied. There are exceptions for certain image sequence operators such as -coalesce. Without a major rewrite, we see no easy solution to this problem other than a scripting language such as PerlMagick.

Re: Unable to 'set' the total number of images!

Posted: 2009-06-13T04:06:45-07:00
by anthony
I figured that was the cause. The "convert" 'list' handling operations (like -fx) naturally so not have that problem as the image is part of the whole list so the number of list elements is known.

I just hoped you would have a simple solution, other than getting the number of images from a 'external' scripted source.

I was hoping to use it to modify the "displace" scaling vector so each image in a -layers compose, list can be modified slightly differently. Prehaps even allow for different -function arguments for a sequence of images.

This is very tricking and highly advanced stuff!!!

Oh well.