|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-02-09 09:06 UTC] senthilnathanns at gmail dot com
[2007-04-13 11:48 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 02:00:01 2025 UTC |
Description: ------------ Here is some functions wanted: imagick_getstorageclass, imagick_getxresolution, imagick_getyresolution, imagick_getunits, imagick_getcompression. Below are source code then can be added for these functions: PHP_FUNCTION( imagick_getstorageclass ) { zval* handle_id ; /* the handle identifier coming from the PHP environment */ imagick_t* handle ; /* the actual imagick_t struct for the handle */ if ( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle_id ) == FAILURE ) { return ; } handle = _php_imagick_get_handle_struct_from_list( &handle_id TSRMLS_CC ) ; if ( !handle ) { php_error( E_WARNING, "%s(): handle is invalid", get_active_function_name( TSRMLS_C ) ) ; RETURN_FALSE ; } _php_imagick_clear_errors( handle ) ; if ( handle->image == ( Image* )NULL ) { RETURN_FALSE ; } RETURN_LONG( handle->image->storage_class ) ; } PHP_FUNCTION( imagick_getxresolution ) { zval* handle_id ; /* the handle identifier coming from the PHP environment */ imagick_t* handle ; /* the actual imagick_t struct for the handle */ if ( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle_id ) == FAILURE ) { return ; } handle = _php_imagick_get_handle_struct_from_list( &handle_id TSRMLS_CC ) ; if ( !handle ) { php_error( E_WARNING, "%s(): handle is invalid", get_active_function_name( TSRMLS_C ) ) ; RETURN_FALSE ; } _php_imagick_clear_errors( handle ) ; if ( handle->image == ( Image* )NULL ) { RETURN_FALSE ; } RETURN_LONG( handle->image->x_resolution ) ; } PHP_FUNCTION( imagick_getyresolution ) { zval* handle_id ; /* the handle identifier coming from the PHP environment */ imagick_t* handle ; /* the actual imagick_t struct for the handle */ if ( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle_id ) == FAILURE ) { return ; } handle = _php_imagick_get_handle_struct_from_list( &handle_id TSRMLS_CC ) ; if ( !handle ) { php_error( E_WARNING, "%s(): handle is invalid", get_active_function_name( TSRMLS_C ) ) ; RETURN_FALSE ; } _php_imagick_clear_errors( handle ) ; if ( handle->image == ( Image* )NULL ) { RETURN_FALSE ; } RETURN_LONG( handle->image->y_resolution ) ; } PHP_FUNCTION( imagick_getunits ) { zval* handle_id ; /* the handle identifier coming from the PHP environment */ imagick_t* handle ; /* the actual imagick_t struct for the handle */ if ( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle_id ) == FAILURE ) { return ; } handle = _php_imagick_get_handle_struct_from_list( &handle_id TSRMLS_CC ) ; if ( !handle ) { php_error( E_WARNING, "%s(): handle is invalid", get_active_function_name( TSRMLS_C ) ) ; RETURN_FALSE ; } _php_imagick_clear_errors( handle ) ; if ( handle->image == ( Image* )NULL ) { RETURN_FALSE ; } RETURN_LONG( handle->image->units ) ; } PHP_FUNCTION( imagick_getcompression ) { zval* handle_id ; /* the handle identifier coming from the PHP environment */ imagick_t* handle ; /* the actual imagick_t struct for the handle */ if ( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle_id ) == FAILURE ) { return ; } handle = _php_imagick_get_handle_struct_from_list( &handle_id TSRMLS_CC ) ; if ( !handle ) { php_error( E_WARNING, "%s(): handle is invalid", get_active_function_name( TSRMLS_C ) ) ; RETURN_FALSE ; } _php_imagick_clear_errors( handle ) ; if ( handle->image == ( Image* )NULL ) { RETURN_FALSE ; } RETURN_LONG( handle->image->compression ) ; }