Fatal error: Uncaught exception 'ImagickException' with message 'Compositing ima

來源:互聯網
上載者:User
$image_name4=$Process.'4.gif';$inimg3=$Process.'1.jpg';$animation3 = new Imagick();$animation3->setFormat("gif");$i=0;$image4 = new Imagick(realpath($image_name4));$image4 = $image4->coalesceImages();foreach($image4 as $frame){ if(!is_file($inimg3)){echo  '浮水印映像不存在';}$img = new Imagick();$img->readImageBlob($frame);$draw = new ImagickDraw();$draw->color(0,0,imagick::PAINT_FLOODFILL);$water = new Imagick(realpath($inimg3));$draw->composite($water->getImageCompose(),0,0,320, 256,$water);$img->drawImage($draw);                        $animation3->addImage( $img );$animation3->setImageDelay( $img->getImageDelay() );//$draw->destroy();                        $water->destroy();$img->destroy();}$animation3->writeImages($Process.''.$id.'X.gif', true);//產生3X$animation3->destroy();


在Linux 下報錯,本地win7是好的:Uncaught exception 'ImagickException' with message 'Compositing image failed' 。
ImagickDraw->composite(40, 0, 0, 320, 256, Object(Imagick)) #1 {main} thrown in



回複討論(解決方案)

目測應該是你的linux下的php中沒有imagick擴充。

linux上有這個。。版本也升到最新了

不是 new Imagick();不行,而是單獨
$draw->composite($water->getImageCompose(),0,0,320, 256,$water); 這一句執行不了

getImageCompose()
這個方法有傳回值?

getImageCompose()
這個方法有傳回值?

有的 這個設定gif延遲的,值為40.

最後還是放棄了composite方法 以後看怎麼樣能正確使用 再更新下吧

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.