With this feature setting the frame delay of the animated images becomes very easy, can I get it on the ImageMagick convert program?-delayfile file
text file containing one number per image giving the display delay per image in centiseconds.
Found a very useful feature on bpgenc.
Found a very useful feature on bpgenc.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Found a very useful feature on bpgenc.
You can build a text file (say delay.txt) as rows of pairs of delays and images
If you are on an older version IM or you remove the restriction on importing files with @ as indirect reads (see your policy.xml file and read viewtopic.php?f=4&t=26801), then you can do
Otherwise on Unix, you can do
Please always provide your IM version and platform, since syntax and scripting may differ.
Code: Select all
-delay 10 lena.jpg
-delay 100 ellipse.png
-delay 500 rose.png
Code: Select all
convert @delay.txt -loop X result.gif
Code: Select all
convert $(cat delay.txt) -loop 0 result.gif
Re: Found a very useful feature on bpgenc.
Code: Select all
<policymap>
<!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
<!-- <policy domain="resource" name="memory" value="2GiB"/> -->
<!-- <policy domain="resource" name="map" value="4GiB"/> -->
<!-- <policy domain="resource" name="width" value="10MP"/> -->
<!-- <policy domain="resource" name="height" value="10MP"/> -->
<!-- <policy domain="resource" name="area" value="1GB"/> -->
<!-- <policy domain="resource" name="disk" value="16EB"/> -->
<!-- <policy domain="resource" name="file" value="768"/> -->
<!-- <policy domain="resource" name="thread" value="4"/> -->
<!-- <policy domain="resource" name="throttle" value="0"/> -->
<!-- <policy domain="resource" name="time" value="3600"/> -->
<!-- <policy domain="system" name="precision" value="6"/> -->
<!-- <policy domain="coder" rights="none" pattern="MVG" /> -->
<!-- <policy domain="delegate" rights="none" pattern="HTTPS" /> -->
<!-- <policy domain="path" rights="none" pattern="@*" /> -->
<policy domain="cache" name="shared-secret" value="passphrase" stealth="true"/>
</policymap>
My IM version: ImageMagick 7.0.3-0 Q16 x64 2016-09-05
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Found a very useful feature on bpgenc.
change
To
Code: Select all
<!-- <policy domain="path" rights="none" pattern="@*" /> -->
Code: Select all
<policy domain="path" rights="read" pattern="@*" />
Re: Found a very useful feature on bpgenc.
Code: Select all
>convert @delay.txt out.gif
convert: unable to open image '@delay.txt': No such file or directory @ error/blob.c/OpenBlob/2695.
convert: invalid argument for option '-delay': 0000.png @ error/convert.c/ConvertImageCommand/1286.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Found a very useful feature on bpgenc.
Then you have not edited the correct policy.xml file. Where is your file? See the information at http://www.imagemagick.org/script/architecture.php and order checked at http://www.imagemagick.org/script/resources.php and read http://www.imagemagick.org/source/policy.xml
I do not know if you have to reboot or not.
You did not answer my question about your Platform. So on Unix, you can find your policy.xml using
if you installed IM in /usr
I do not know if you have to reboot or not.
You did not answer my question about your Platform. So on Unix, you can find your policy.xml using
Code: Select all
find /usr | grep "policy.xml"
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Found a very useful feature on bpgenc.
You can also try setting it to
But I would have thought that all you needed was "read"
Code: Select all
<policy domain="path" rights="read | write" pattern="@*" />
Re: Found a very useful feature on bpgenc.
Code: Select all
D:\Program Files\ImageMagick-7.0.3-Q16\policy.xml
D:\Program Files\ImageMagick-7.0.3-Q16\www\source\policy.xml
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Found a very useful feature on bpgenc.
If neither work, then you will need advice from one of the Developers or someone who knows more about policy.xml than I. You can post to Bugs forum, if no one else has a solution or confirms that it does not work.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Found a very useful feature on bpgenc.
D:\Program Files\ImageMagick-7.0.3-Q16\policy.xml
I do not know Windows. If that is the installed code and not just the download from IM, then that would be the one to edit. Try rebooting afterwards.
I do not know Windows. If that is the installed code and not just the download from IM, then that would be the one to edit. Try rebooting afterwards.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Found a very useful feature on bpgenc.
You can get around this by simply reading the file into a variable and using the variable in your command line. Sorry I do not know windows, but in unix
Code: Select all
variable=$(cat delay.txt)
magick $variable -loop N -layers optimize result.gif
Re: Found a very useful feature on bpgenc.
Anyway, thank you very much.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Found a very useful feature on bpgenc.
What are the contents of the file delay.txt? (If the file is long, just the first few lines.)
snibgo's IM pages: im.snibgo.com
Re: Found a very useful feature on bpgenc.
Code: Select all
-delay 5 0000.png
-delay 5 0001.png
-delay 5 0002.png
-delay 5 0003.png
-delay 5 0004.png
-delay 5 0005.png
-delay 5 0006.png
-delay 5 0007.png
-delay 5 0008.png
-delay 5 0009.png
-delay 5 0010.png
-delay 5 0011.png
-delay 5 0012.png
-delay 5 0013.png
-delay 5 0014.png
-delay 5 0015.png
-delay 5 0016.png
-delay 5 0017.png
-delay 5 0018.png
-delay 5 0019.png
-delay 5 0020.png
-delay 5 0021.png
-delay 5 0022.png
-delay 5 0023.png
-delay 5 0024.png
-delay 5 0025.png
-delay 5 0026.png
-delay 5 0027.png
-delay 5 0028.png
-delay 5 0029.png
-delay 5 0030.png
-delay 5 0031.png
-delay 5 0032.png
-delay 5 0033.png
-delay 5 0034.png
-delay 5 0035.png
-delay 5 0036.png
-delay 5 0037.png
-delay 5 0038.png
-delay 5 0039.png
-delay 5 0040.png
-delay 5 0041.png
-delay 5 0042.png
-delay 5 0043.png
-delay 5 0044.png
-delay 5 0045.png
-delay 5 0046.png
-delay 5 0047.png
-delay 5 0048.png
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Found a very useful feature on bpgenc.
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?
snibgo's IM pages: im.snibgo.com