php教程

Imagick::clear

(PECL imagick 2.0.0)

Imagick::clearClears all resources associated to Imagick object

说明

Imagick::clear ( void ) : bool

Clears all resources associated to Imagick object

返回值

成功时返回 TRUE

User Contributed Notes

kd0bpv at gmail dot com 05-Mar-2014 10:31
Imagick::destroy() has been deprecated in favor of Imagick::clear().
admin at dinacel dot com 16-Jun-2013 03:18
Destroy and clear methods seem to do exactly the same thing
@see http://svn.php.net/viewvc/pecl/imagick/trunk/imagick_class.c?view=markup (l.3066 & l.3087)

The code is duplicated, they do the same thing a bit differently.
markus dot s dot schmitz at gmail dot com 11-Dec-2012 08:46
One might be suprised that there seems to be no difference between:

<?php
$imagick
= new Imagick();
$imagick->clear();
$imagick->readImage('myfile.jpg');
?>

and

<?php
$imagick
= new Imagick();
$imagick->destroy();
$imagick->readImage('myfile.jpg');
?>

Both functions reset all options and clear all used resources so you might want to use either one of them.
See also: http://php.net/manual/en/imagick.destroy.php

CopyRight © 2008-2022 verySource.Com All Rights reserved. 京ICP备17048824号-1 京公网安备:11010502034788