Unable to 'set' the total number of images!

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Unable to 'set' the total number of images!

Post 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 :-)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

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

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply