Page 2 of 2

Re: Found a very useful feature on bpgenc.

Posted: 2016-09-11T22:32:43-07:00
by GeeMack
snibgo wrote:Well, we know that IM is reading delay.txt because the error message mentions 0000.png. I can't see what is wrong. I assume 0000.png etc exist?
I'm using IM 7.0.3 on Windows 10 64, and I get the same error as pikashi describes above. It seems IM wants to read everything in that file as images, so it complains about how it's "unable to open image '-delay': No such file or directory". It appears to read the actual image files, and indicates they're being read when I add "-monitor" to the command, but it chokes on all the "-delay"s and "5"s.

I've also worked the policy.xml file a few different ways, but my installation (from ImageMagick-7.0.3-0-Q16-HDRI-x64-static.exe) comes with that line commented out like this...

Code: Select all

  <!-- <policy domain="path" rights="read" pattern="@*" /> -->
My IM will happily read lists of images from a text file when I precede the filename with the "@", even without editing that policy file.

Re: Found a very useful feature on bpgenc.

Posted: 2016-09-11T23:30:56-07:00
by snibgo
V7 handling for "@" scripts is different to v6. In v7, the script had to start with an image or "(", but then could contain anything. It was (we are told) designed only for handling a list of images, but it could also read and process options.

In v7, this changed so "@" scripts couldn't contain options. I would have though it could also handle options that precede images, but perhaps not.

Of course, v7 has "-script" scripts. These can contain options. They have to, because the script never returns to read the rest of the command line.

Re: Found a very useful feature on bpgenc.

Posted: 2016-09-12T10:50:37-07:00
by fmw42
snibgo wrote:V7 handling for "@" scripts is different to v6. In v7, the script had to start with an image or "(", but then could contain anything. It was (we are told) designed only for handling a list of images, but it could also read and process options.

In v7, this changed so "@" scripts couldn't contain options. I would have though it could also handle options that precede images, but perhaps not.

Of course, v7 has "-script" scripts. These can contain options. They have to, because the script never returns to read the rest of the command line.
Snibgo: is this documented somewhere. This is the first I have heard about not allowing options.

Re: Found a very useful feature on bpgenc.

Posted: 2016-09-12T12:44:24-07:00
by GeeMack
snibgo wrote:In v7, this changed so "@" scripts couldn't contain options. I would have though it could also handle options that precede images, but perhaps not.
With 7.0.3 on Windows I tried bringing in a @textfile.txt with options before and/or after the image files. I tried starting with parentheses and without. I tried starting with an image before any lines with options. Nothing seemed to work except a list of just images. Everything else died from errors saying "(" or "-delay" or "5" wasn't an image.

Re: Found a very useful feature on bpgenc.

Posted: 2016-09-12T12:56:55-07:00
by fmw42
I am getting the same error messages

tmp.txt is

Code: Select all

-delay 10 lena.jpg 
-delay 100 ellipse.png 
-delay 500 rose.png
Command is:

Code: Select all

convert @tmp.txt -loop 0 result.gif
convert: invalid argument for option `-delay': lena.jpg @ error/convert.c/ConvertImageCommand/1254.

in IM 6.9.5-9 Q16 (on my Mac OSX snow leopard) after setting my policy.xml to

Code: Select all

  <policy domain="path" rights="read" pattern="@*"/>
So it is not restricted to IM 7. Perhaps IM 6 never allowed anything but a list of images??

Re: Found a very useful feature on bpgenc.

Posted: 2016-09-12T13:56:13-07:00
by snibgo
Is what documented where?

"-script" never returns is in http://www.imagemagick.org/script/porting.php

"@" scripts have never been properly documented, as far as I know. For using "@" scripts merely with a list of filenames, see http://www.imagemagick.org/script/comma ... essing.php , under "Filename References". There is no documentation that says "@" scripts can do other things, or that they can't.

When I have brought up the topic in these forums, I was told that "@" were never intended for anything other than lists of files.

But they currently can, in v6, provided they start with an image. For example, a text file called "rose.scr" contains:

Code: Select all

rose: +write rose.png
+delete
rose.png ( +clone ) +write info: -append
Then the command:

Code: Select all

convert @rose.scr r2.png
in IM v6.9.5-3 does exactly what we would hope.

The "-delay" script doesn't start with an image, so doesn't work under v6. To make it work, do a no-op at the start, eg:

Code: Select all

xc: +delete
-delay 10 lena.jpg 
-delay 100 ellipse.png 
-delay 500 rose.png
EDIT: I should stress that these examples don't work under v7 "magick", because v7 "@" scripts should be merely lists of files, and "-script" scripts need to write to the output. However, the following does work under v7.0.2-5:

Code: Select all

magick convert @rose.scr r2.png

Re: Found a very useful feature on bpgenc.

Posted: 2016-09-12T14:29:06-07:00
by fmw42
I was asking about @textfile.txt

Interesting about using an xc: first image.

I suspect you can also just reverse the image and delay, such as

Code: Select all

lena.jpg -set delay 10
ellipse.png -set delay 100
rose.png -set delay 500