首页新萄京娱乐网址2492777 › Trying to clone an uncloneable object of class Imagic的消弭方法

Trying to clone an uncloneable object of class Imagic的消弭方法

暗许是On,改为Off后,就能够减轻。

在windows下安装完后唤醒:
Fatal error: Trying to clone an uncloneable object of class Imagick in
C:\www\hx\pdf_to_png.php on line 17

附pdf转png的程序代码片断:
复制代码 代码如下:
        function pdf2png($pdf, $filename, $page=0) {         
            if (!extension_loaded('imagick')) {
                exit('no imagick');
                return false;               
            }
            if (!file_exists($pdf)) {
                return false;
            } 
            $im = new Imagick();
            $im->setResolution(120, 120);
            $im->setCompressionQuality(100);
            $im->readImage($pdf . "[" . $page . "]");
            $im->setImageFormat('png');
            $im->writeImage($filename);
            $im->readImage($filename);
            $im->resizeImage(120, 150, Imagick::FILTER_LANCZOS,
1);
            $im->writeImage($filename);
            return $filename;
        }

万意气风发别的扩大现身那类错误,平常也是足以应用那二种艺术解决的。

新萄京娱乐网址2492777,1.php.ini中; Enable compatibility mode with Zend Engine 1 (PHP 4.x)
zend.ze1_compatibility_mode = Off

2.运用imagick::...这种艺术调用。
即$im->setResolution(120, 120State of Qatar;能够改写为:
imagick::setResolution(120, 120);

选拔IIS和Apache均会有这一个提醒。经屡屡测验后,开掘三种减轻办法:

转载本站文章请注明出处:新萄京娱乐网址2492777 http://www.cdhbjs.com/?p=5355

上一篇:

下一篇:

相关文章