cvs: pecl /imagick imagick.c
| From: | Mikko Koppanen | Date: | Wed, 12 Sep 2007 21:59:37 +0000 |
| Subject: | cvs: pecl /imagick imagick.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-8554@lists.php.net to get a copy of this message | ||
mkoppanen Wed Sep 12 21:59:37 2007 UTC
Modified files:
/pecl/imagick imagick.c
Log:
Imagick::getImageLength is the replacement for the deprecated Imagick::getImageSize
http://cvs.php.net/viewvc.cgi/pecl/imagick/imagick.c?r1=1.147&r2=1.148&diff_format=u
Index: pecl/imagick/imagick.c
diff -u pecl/imagick/imagick.c:1.147 pecl/imagick/imagick.c:1.148
--- pecl/imagick/imagick.c:1.147 Tue Sep 11 20:16:37 2007
+++ pecl/imagick/imagick.c Wed Sep 12 21:59:37 2007
@@ -197,6 +197,7 @@
PHP_METHOD(imagick, getimagefilename);
PHP_METHOD(imagick, getimageformat);
PHP_METHOD(imagick, getimagesize);
+PHP_METHOD(imagick, getimagelength);
PHP_METHOD(imagick, getimagegeometry);
PHP_METHOD(imagick, getimagecolors);
PHP_METHOD(imagick, scaleimage);
@@ -2408,6 +2409,7 @@
PHP_ME(imagick, clear, imagick_zero_args, ZEND_ACC_PUBLIC)
PHP_ME(imagick, clone, imagick_zero_args, ZEND_ACC_PUBLIC)
PHP_ME(imagick, getimagesize, imagick_zero_args, ZEND_ACC_PUBLIC)
+ PHP_ME(imagick, getimagelength, imagick_zero_args, ZEND_ACC_PUBLIC)
PHP_ME(imagick, getimageblob, imagick_zero_args, ZEND_ACC_PUBLIC)
PHP_ME(imagick, getimagesblob, imagick_zero_args, ZEND_ACC_PUBLIC)
PHP_ME(imagick, setfirstiterator, imagick_zero_args, ZEND_ACC_PUBLIC)
@@ -8750,6 +8752,31 @@
}
/* }}} */
+/* {{{ proto int Imagick::getImageLength()
+ returns the image length in bytes
+*/
+PHP_METHOD(imagick, getimagelength)
+{
+ php_imagick_object *intern;
+ zval *object;
+ MagickSizeType length;
+ MagickBooleanType status;
+
+ IMAGICK_INITIALIZE_ZERO_ARGS( object, php_imagick_object *, intern );
+ IMAGICK_CHECK_NOT_EMPTY( intern->magick_wand, 1, 1 );
+
+ status = MagickGetImageLength( intern->magick_wand, &length );
+
+ if ( status == MagickFalse )
+ {
+ throwExceptionWithMessage( 1, "Unable to acquire image length", 1 TSRMLS_CC );
+ RETURN_FALSE;
+ }
+
+ RETVAL_LONG( length );
+}
+/* }}} */
+
/* {{{ proto string Imagick::getImageBlob()
Returns the current image sequence as a string
*/