小编Fed*_*cci的帖子

使用 php shell_exec() 触发时,ImageMagick unix shell 脚本不起作用

我必须使用 Fred 的 ImageMagick 脚本创建图像的过渡序列,特别是fx 过渡

在我的 php 代码中,我将所有图像调整为标准尺寸,然后将所有这些图片重命名为 pic000001.jpg、pic000002.jpg、pic000003.jpg 等(我用 $count 进行计数),然后我愿意:

$frameIndex=0;
$frames=18;

//for all the pic000001.jpg, pic000002.jpg, pic000003.jpg.... do a transition 
//between them
for($seq=1;$seq<$count;$seq++){

        //here I take a picture and the next(IE pic000001 and pic000002)
        echo shell_exec("fxtransitions -e swirl -f $frames -d 20 -p 50 $path/pic".str_pad($seq, 6, '0', STR_PAD_LEFT).".jpg $path/pic".str_pad(($seq+1), 6, '0', STR_PAD_LEFT).".jpg $path/fx%06d.jpg");

        //here I rename the temporany frames called 
        //fx000000.jpg to fx000035.jpg for each transition 
        //to a common index
        for($c=0;$c<($frames*2);$c++){
            rename("fx".str_pad($c, 6, '0', …
Run Code Online (Sandbox Code Playgroud)

php imagemagick shell-exec

1
推荐指数
1
解决办法
1366
查看次数

标签 统计

imagemagick ×1

php ×1

shell-exec ×1