cvs: pear /PECL/imagick Changes Makefile.in config.m4 imagick.c imagick.php package.xml php_imagick.h /PECL/imagick/doc
function.imagick-annotate.html function.imagick-convert.html function.imagick-create.html function.imagick-crop.html function.imagick-dump.html
function.imagick-free.html function.imagick-get-attribute.html function.imagick-morph.html function.imagick-read.html function.imagick-resize.html
function.imagick-rotate.html function.imagick-sample.html function.imagick-set-attribute.html function.imagick-shear.html function.imagick-write.html
function.list-magickinfo.html ref.imagick.html /PECL/imagick/xml imagick.xml

From: Date: Tue, 04 Dec 2001 09:28:55 +0000
Subject: cvs: pear /PECL/imagick Changes Makefile.in config.m4 imagick.c imagick.php package.xml php_imagick.h /PECL/imagick/doc
function.imagick-annotate.html function.imagick-convert.html function.imagick-create.html function.imagick-crop.html function.imagick-dump.html
function.imagick-free.html function.imagick-get-attribute.html function.imagick-morph.html function.imagick-read.html function.imagick-resize.html
function.imagick-rotate.html function.imagick-sample.html function.imagick-set-attribute.html function.imagick-shear.html function.imagick-write.html
function.list-magickinfo.html ref.imagick.html /PECL/imagick/xml imagick.xml
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-1461@lists.php.net to get a copy of this message
chregu Tue Dec 4 04:28:55 2001 EDT Added files: /pear/PECL/imagick Changes /pear/PECL/imagick/doc function.imagick-annotate.html Modified files: /pear/PECL/imagick Makefile.in config.m4 imagick.c imagick.php package.xml php_imagick.h /pear/PECL/imagick/doc function.imagick-convert.html function.imagick-create.html function.imagick-crop.html function.imagick-dump.html function.imagick-free.html function.imagick-get-attribute.html function.imagick-morph.html function.imagick-read.html function.imagick-resize.html function.imagick-rotate.html function.imagick-sample.html function.imagick-set-attribute.html function.imagick-shear.html function.imagick-write.html function.list-magickinfo.html ref.imagick.html /pear/PECL/imagick/xml imagick.xml Log: New Release: - added andrei as author - better config support - better errorhandling - support for php < 4.1 - annotate text function

Index: pear/PECL/imagick/Makefile.in diff -u pear/PECL/imagick/Makefile.in:1.2 pear/PECL/imagick/Makefile.in:1.3 --- pear/PECL/imagick/Makefile.in:1.2 Thu Nov 22 14:10:43 2001 +++ pear/PECL/imagick/Makefile.in Tue Dec 4 04:28:54 2001 @@ -1,7 +1,7 @@ -# $Id: Makefile.in,v 1.2 2001/11/22 19:10:43 chregu Exp $ +# $Id: Makefile.in,v 1.3 2001/12/04 09:28:54 chregu Exp $ LTLIBRARY_NAME = libimagick.la LTLIBRARY_SOURCES = imagick.c LTLIBRARY_SHARED_NAME = imagick.la -LTLIBRARY_SHARED_LIBADD = $(IMAGICK_SHARED_LIBADD) -lMagick +LTLIBRARY_SHARED_LIBADD = $(IMAGICK_SHARED_LIBADD) include $(top_srcdir)/build/dynlib.mk Index: pear/PECL/imagick/config.m4 diff -u pear/PECL/imagick/config.m4:1.2 pear/PECL/imagick/config.m4:1.3 --- pear/PECL/imagick/config.m4:1.2 Thu Nov 22 14:10:44 2001 +++ pear/PECL/imagick/config.m4 Tue Dec 4 04:28:54 2001 @@ -1,59 +1,64 @@ -dnl $Id: config.m4,v 1.2 2001/11/22 19:10:44 chregu Exp $ -dnl config.m4 for extension imagick - -dnl Comments in this file start with the string 'dnl'. -dnl Remove where necessary. This file will not work -dnl without editing. - -dnl If your extension references something external, use with: +dnl +dnl $Id: config.m4,v 1.3 2001/12/04 09:28:54 chregu Exp $ +dnl PHP_ARG_WITH(imagick, for imagick support, Make sure that the comment is aligned: -[ --with-imagick Include imagick support]) - -dnl Otherwise use enable: - -dnl PHP_ARG_ENABLE(imagick, whether to enable imagick support, -dnl Make sure that the comment is aligned: -dnl [ --enable-imagick Enable imagick support]) +[ --with-imagick[=DIR] Include imagick support]) if test "$PHP_IMAGICK" != "no"; then - dnl Write more examples of tests here... - PHP_ADD_LIBRARY(Magick) - dnl # --with-imagick -> check with-path - dnl SEARCH_PATH="/usr/local /usr" # you might want to change this - dnl SEARCH_FOR="/include/magick.h" # you most likely want to change this - dnl if test -r $PHP_imagick/$SEARCH_FOR; then # path given as parameter - dnl imagick_DIR=$PHP_imagick - dnl else # search default path list - dnl AC_MSG_CHECKING([for imagick files in default path]) - dnl for i in $SEARCH_PATH ; do - dnl if test -r $i/$SEARCH_FOR; then - dnl imagick_DIR=$i - dnl AC_MSG_RESULT(found in $i) - dnl fi - dnl done - dnl fi - dnl - dnl if test -z "$imagick_DIR"; then - dnl AC_MSG_RESULT([not found]) - dnl AC_MSG_ERROR([Please reinstall the imagick distribution]) - dnl fi - - dnl # --with-imagick -> add include path - dnl PHP_ADD_INCLUDE($imagick_DIR/include) - - dnl # --with-imagick -> chech for lib and symbol presence - dnl LIBNAME=imagick # you may want to change this - dnl LIBSYMBOL=imagick # you most likely want to change this - dnl old_LIBS=$LIBS - dnl LIBS="$LIBS -L$imagick_DIR/lib -lm -ldl" - dnl AC_CHECK_LIB($LIBNAME, $LIBSYMBOL, [AC_DEFINE(HAVE_imagick_LIB,1,[ ])], - dnl [AC_MSG_ERROR([wrong imagick lib version or lib not found])]) - dnl LIBS=$old_LIBS - dnl - dnl PHP_SUBST(imagick_SHARED_LIBADD) - dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $imagick_DIR/lib, imagick_SHARED_LIBADD) + if test -r $PHP_IMAGICK/include/magick/magick.h; then + IMAGEMAGICK_DIR=$PHP_IMAGICK + else + AC_MSG_CHECKING(for ImageMagick in default path) + for i in /usr/local /usr; do + if test -r $i/include/magick/magick.h; then + IMAGEMAGICK_DIR=$i + AC_MSG_RESULT(found in $i) + fi + done + fi + + if test -z "$IMAGEMAGICK_DIR"; then + AC_MSG_RESULT(not found) + AC_MSG_ERROR(Please reinstall the ImageMagick distribution - + magick.h should be in <imagemagick-dir>/include/magick/) + fi + + IMAGEMAGICK_CONFIG="Magick-config" + AC_MSG_CHECKING(for ImageMagick 5.3.8 or greater) + + if ${IMAGEMAGICK_DIR}/bin/Magick-config --libs print > /dev/null 2>&1; then + IMAGEMAGICK_CONFIG=${IMAGEMAGICK_DIR}/bin/Magick-config + else + if ${IMAGEMAGICK_DIR}/Magick-config --libs print > /dev/null 2>&1; then + IMAGEMAGICK_CONFIG=${IMAGEMAGICK_DIR}/Magick-config + fi + fi + + imagemagick_version_full=`$IMAGEMAGICK_CONFIG --version` + imagemagick_version=`echo ${imagemagick_version_full} | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` + AC_MSG_RESULT($imagemagick_version_full) + if test "$imagemagick_version" -ge 5003008; then + IMAGEMAGICK_LIBS=`$IMAGEMAGICK_CONFIG --libs` + IMAGEMAGICK_LDFLAGS=`$IMAGEMAGICK_CONFIG --ldflags` + else + AC_MSG_ERROR(ImageMagick version 5.3.8 or later is required to compile php with imagick support) + fi + + PHP_ADD_INCLUDE($IMAGEMAGICK_DIR/include) + PHP_EVAL_LIBLINE($IMAGEMAGICK_LIBS, IMAGICK_SHARED_LIBADD) + PHP_ADD_LIBRARY_WITH_PATH(Magick, $IMAGEMAGICK_DIR/lib, IMAGICK_SHARED_LIBADD) + + AC_CHECK_LIB(Magick,InitializeMagick, + [ + AC_DEFINE(HAVE_IMAGICK,1,[ ]) + ],[ + AC_MSG_ERROR(There is something wrong. Please check config.log for more information.) + ],[ + $IMAGEMAGICK_LIBS -L$IMAGEMAGICK_DIR/lib $IMAGEMAGICK_LDFLAGS + ]) PHP_EXTENSION(imagick, $ext_shared) + PHP_SUBST(IMAGICK_SHARED_LIBADD) fi Index: pear/PECL/imagick/imagick.c diff -u pear/PECL/imagick/imagick.c:1.2 pear/PECL/imagick/imagick.c:1.3 --- pear/PECL/imagick/imagick.c:1.2 Thu Nov 22 14:10:44 2001 +++ pear/PECL/imagick/imagick.c Tue Dec 4 04:28:54 2001 @@ -13,10 +13,11 @@ | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Christian Stocker <chregu@bitflux.ch> | - | | + | andrei nigmatulin <anight@mail.ru> | +----------------------------------------------------------------------+ */ +/* $Id: imagick.c,v 1.3 2001/12/04 09:28:54 chregu Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -25,15 +26,20 @@ #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" +#include "ext/standard/php_smart_str.h" #include "php_imagick.h" +#define imagick_warning() MagickWarning(exception.severity, exception.reason, exception.description) +#define imagick_warning_p() MagickWarning(exception_p->severity, exception_p->reason, exception_p->description) +#define DegreesToRadians(x) ((x)*3.14159265358979323846/180.0) /* If you declare any globals in php_imagick.h uncomment this: */ ZEND_DECLARE_MODULE_GLOBALS(imagick) /* True global resources - no need for thread safety here */ static int le_imagick; +static char *_php_imagick_client_name = "php_extension"; /* {{{ imagick_functions[] * @@ -49,6 +55,7 @@ PHP_FE(imagick_shear, NULL) PHP_FE(imagick_rotate, NULL) PHP_FE(imagick_oilpaint, NULL) + PHP_FE(imagick_annotate, NULL) PHP_FE(imagick_morph, NULL) PHP_FE(imagick_write, NULL) PHP_FE(imagick_list_magickinfo, NULL) @@ -65,7 +72,9 @@ /* {{{ imagick_module_entry */ zend_module_entry imagick_module_entry = { +#ifdef STANDARD_MODULE_HEADER STANDARD_MODULE_HEADER, +#endif "imagick", imagick_functions, PHP_MINIT(imagick), @@ -73,7 +82,9 @@ PHP_RINIT(imagick), /* Replace with NULL if there's nothing to do at request start */ PHP_RSHUTDOWN(imagick), /* Replace with NULL if there's nothing to do at request end */ PHP_MINFO(imagick), +#ifdef NO_VERSION_YET NO_VERSION_YET, +#endif STANDARD_MODULE_PROPERTIES }; /* }}} */ @@ -111,13 +122,45 @@ */ /* }}} */ +static void _php_imagick_warning_handler(const ExceptionType warning, + const char *reason, const char *description) { + + if (reason == (char *) NULL) return; + + php_error(E_WARNING, "%s(): %.1024s (%.1024s) [%.1024s]", + get_active_function_name(TSRMLS_C), + reason, + (description != (char *) NULL) ? description : "", + ((warning != OptionWarning) && errno) ? strerror(errno) : "" + ); +} + + +static php_imagick *_php_imagick_new() { + + php_imagick *handle; + handle = (php_imagick *) emalloc(sizeof(php_imagick)); + + if (!handle) { + php_error(E_WARNING, "%s(): couldn't allocate PHP-Magick handle", get_active_function_name(TSRMLS_C)); + return (php_imagick *) NULL; + } + + memset(handle, 0, sizeof(php_imagick)); + handle->info = CloneImageInfo((ImageInfo *) NULL); + + return handle; + +} + static void _php_imagick_free(php_imagick *handle) { - if (handle->image) - { - DestroyImage(handle->image); + if (handle->image) { + DestroyImage(handle->image); + } + if (handle->info) { + DestroyImageInfo(handle->info); } - DestroyImageInfo(handle->info); efree(handle); } @@ -150,6 +193,8 @@ le_imagick = register_list_destructors(_php_imagick_free,NULL); + InitializeMagick(_php_imagick_client_name); + SetWarningHandler(_php_imagick_warning_handler); return SUCCESS; } /* }}} */ @@ -161,6 +206,7 @@ /* uncomment this line if you have INI entries UNREGISTER_INI_ENTRIES(); */ + DestroyMagick(); return SUCCESS; } /* }}} */ @@ -187,11 +233,31 @@ */ PHP_MINFO_FUNCTION(imagick) { - int *version; + unsigned int version; + smart_str format_list = {0}; + MagickInfo *magick_info; + ExceptionInfo exception; + register MagickInfo *p; php_info_print_table_start(); php_info_print_table_header(2, "imagick support", "enabled"); - php_info_print_table_row(2, "ImageMagickVersion", GetMagickVersion(version)); + php_info_print_table_row(2, "ImageMagick version", GetMagickVersion(&version)); + + GetExceptionInfo(&exception); + + magick_info = GetMagickInfo(NULL, &exception); + + if (magick_info != (MagickInfo *) NULL) { + for (p = magick_info; p != (MagickInfo *) NULL; p = p->next) { + smart_str_appendl(&format_list, p->name, strlen(p->name)); + if (p->next) { + smart_str_appendl(&format_list, ", ", 2); + } + } + smart_str_0(&format_list); + php_info_print_table_row(2, "Supported image formats", format_list.c); + } + php_info_print_table_end(); @@ -223,17 +289,12 @@ PHP_FUNCTION(imagick_new) { - php_imagick *handle; - - handle = (php_imagick *)emalloc(sizeof(php_imagick)); + php_imagick *handle = _php_imagick_new(); if (!handle) { - php_error(E_WARNING, "%s() couldn't allocate PHP-Magick handle", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } - memset(handle, 0, sizeof(php_imagick)); - handle->info = CloneImageInfo((ImageInfo *) NULL);; ZEND_REGISTER_RESOURCE(return_value, handle, le_imagick); } @@ -249,8 +310,7 @@ int infile_len = 0; int argc = ZEND_NUM_ARGS(); php_imagick *handle; - ExceptionInfo - exception; + ExceptionInfo exception; Image *next_image; register Image *p; @@ -265,13 +325,13 @@ MAKE_STD_ZVAL(userdata); if (array_init(userdata) != SUCCESS) { - php_error(E_ERROR,"%s() Problems with creating array",get_active_function_name(TSRMLS_C)); + php_error(E_ERROR,"%s(): Problems with creating array",get_active_function_name(TSRMLS_C)); RETVAL_FALSE; return; } if (add_index_stringl(userdata,0,infile,infile_len,1) != SUCCESS) { - php_error(E_ERROR,"%s() Problems with adding string to array",get_active_function_name(TSRMLS_C)); + php_error(E_ERROR,"%s(): Problems with adding string to array",get_active_function_name(TSRMLS_C)); RETVAL_FALSE; return; } @@ -303,14 +363,21 @@ while(zend_hash_get_current_data(target_hash, (void **)&entry) == SUCCESS) { convert_to_string_ex(entry); + + if (Z_STRLEN_PP(entry) > MaxTextExtent-1) { + php_error(E_WARNING, "%s(): Too long file name", get_active_function_name(TSRMLS_C)); + RETURN_FALSE; + } + strncpy( handle->info->filename, Z_STRVAL_PP(entry), MaxTextExtent-1 ); + + GetExceptionInfo(&exception); next_image=ReadImage(handle->info,&exception); if ( next_image == (Image *)NULL ) { - php_error(E_ERROR,"%s() Problems with opening file %s: %s",get_active_function_name(TSRMLS_C),infile,exception.reason); - RETVAL_FALSE; - return; + imagick_warning(); + RETURN_FALSE; } if (handle->image == (Image *) NULL) @@ -346,6 +413,7 @@ int er; int argc = ZEND_NUM_ARGS(); php_imagick *handle; + ExceptionInfo *exception_p; register Image *p; long @@ -364,6 +432,10 @@ strncpy( handle->image->magick, outformat, MaxTextExtent-1 ); } */ + if (outfile_len > MaxTextExtent-1) { + php_error(E_WARNING, "%s(): Too long file name", get_active_function_name(TSRMLS_C)); + RETURN_FALSE; + } (void) strncpy(handle->info->filename,outfile,MaxTextExtent-1); for (p=(handle->image); p != (Image *) NULL; p=p->next) { @@ -376,9 +448,9 @@ er = WriteImage(handle->info,p); if ( er == 0 ) { - php_error(E_ERROR,"%s() cannot save file %s: %s",get_active_function_name(TSRMLS_C), outfile,handle->image->exception.reason); - RETVAL_FALSE; - return; + exception_p = &(handle->image)->exception; + imagick_warning_p(); + RETURN_FALSE; } if (handle->info->adjoin) @@ -412,9 +484,8 @@ handle->image = SampleImage(handle->image,columns,rows,&exception); if ( handle->image == (Image *)NULL ) { - php_error(E_ERROR,"%s() error sampling image: %s",get_active_function_name(TSRMLS_C), exception.reason); - RETVAL_FALSE; - return; + imagick_warning(); + RETURN_FALSE; } } @@ -445,9 +516,8 @@ handle->image = ResizeImage(handle->image,columns,rows,filter,blur,&exception); if ( handle->image == (Image *)NULL ) { - php_error(E_ERROR,"%s() error resizing image: %s",get_active_function_name(TSRMLS_C), exception.reason); - RETVAL_FALSE; - return; + imagick_warning(); + RETURN_FALSE; } RETVAL_TRUE; } @@ -482,9 +552,8 @@ efree(rect); if ( handle->image == (Image *)NULL ) { - php_error(E_ERROR,"%s() error croping image: %s",get_active_function_name(TSRMLS_C), exception.reason); - RETVAL_FALSE; - return; + imagick_warning(); + RETURN_FALSE; } RETVAL_TRUE; } @@ -511,9 +580,8 @@ if ( handle->image == (Image *)NULL ) { - php_error(E_ERROR,"%s() error rotating image: %s",get_active_function_name(TSRMLS_C), exception.reason); - RETVAL_FALSE; - return; + imagick_warning(); + RETURN_FALSE; } RETVAL_TRUE; } @@ -541,9 +609,8 @@ if ( handle->image == (Image *)NULL ) { - php_error(E_ERROR,"%s() error shearing image: %s",get_active_function_name(TSRMLS_C), exception.reason); - RETVAL_FALSE; - return; + imagick_warning(); + RETURN_FALSE; } RETVAL_TRUE; } @@ -571,9 +638,8 @@ if ( handle->image == (Image *)NULL ) { - php_error(E_ERROR,"%s() error oilpainting image: %s",get_active_function_name(TSRMLS_C), exception.reason); - RETVAL_FALSE; - return; + imagick_warning(); + RETURN_FALSE; } RETVAL_TRUE; } @@ -601,14 +667,154 @@ if ( handle->image == (Image *)NULL ) { - php_error(E_ERROR,"%s() error morphing image: %s",get_active_function_name(TSRMLS_C), exception.reason); - RETVAL_FALSE; - return; + imagick_warning(); + RETURN_FALSE; } RETVAL_TRUE; } +/* {{{ proto bool imagick_morph(resource handle, int number_frames) + crops an image +*/ +PHP_FUNCTION(imagick_annotate) +{ + zval *arg; + zval *userdata; + + int argc = ZEND_NUM_ARGS(); + ExceptionInfo exception; + DrawInfo *drawinfo; + char *text= NULL; + php_imagick *handle; + zval **entry; /* pointer to array entry */ + char *key; + HashTable *target_hash; +char message[MaxTextExtent]; + AffineMatrix + affine, + current; + + if (zend_parse_parameters(argc TSRMLS_CC, "ra", &arg, &userdata) == FAILURE) return; + + ZEND_FETCH_RESOURCE(handle, php_imagick *, &arg, -1, "imagick object", le_imagick); + + drawinfo = CloneDrawInfo(handle->info,(DrawInfo *) NULL); + (void) CloneString(&drawinfo->primitive,""); + /* Set up known arguments */ + target_hash = HASH_OF(userdata); + zend_hash_internal_pointer_reset(target_hash); + + /* Iterate through hash */ + while(zend_hash_get_current_data(target_hash, (void **)&entry) == SUCCESS) + { + zend_hash_get_current_key(target_hash, &key,NULL,0); + + switch (*key) + { + case 'a': + case 'A': + if (LocaleCompare(key,"antialias") == 0) + { + + drawinfo->stroke_antialias=Z_LVAL_PP(entry) != 0; + drawinfo->text_antialias=Z_LVAL_PP(entry) != 0; + break; + } + break; + case 'f': + case 'F': + if (LocaleCompare(key,"font") == 0) + { + CloneString(&drawinfo->font, Z_STRVAL_PP(entry)); + break; + } + if (LocaleCompare(key,"fill") == 0) + { + (void) QueryColorDatabase(Z_STRVAL_PP(entry),&drawinfo->fill); + break; + } + + break; + case 'g': + case 'G': + /* no effect yet ..... */ + if (LocaleCompare(key,"geometry") == 0) + { + CloneString(&drawinfo->geometry, Z_STRVAL_PP(entry)); + break; + } + break; + case 'r': + case 'R': + if (LocaleCompare(key,"rotate") == 0) + { + current=drawinfo->affine; + IdentityAffine(&affine); + if (Z_LVAL_PP(entry) == 0.0) + break; + affine.sx=cos(DegreesToRadians(fmod(Z_LVAL_PP(entry),360.0))); + affine.rx=sin(DegreesToRadians(fmod(Z_LVAL_PP(entry),360.0))); + affine.ry=(-sin(DegreesToRadians(fmod(Z_LVAL_PP(entry),360.0)))); + affine.sy=cos(DegreesToRadians(fmod(Z_LVAL_PP(entry),360.0))); + drawinfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx; + drawinfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx; + drawinfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy; + drawinfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy; + drawinfo->affine.tx= + current.sx*affine.tx+current.ry*affine.ty+current.tx; + drawinfo->affine.ty= + current.rx*affine.tx+current.sy*affine.ty+current.ty; + + break; + } + break; + + case 'p': + case 'P': + if (LocaleCompare(key,"primitive") == 0 ) + { + CloneString(&drawinfo->primitive, Z_STRVAL_PP(entry)); + break; + } + if (LocaleCompare(key,"pointsize") == 0) + { + drawinfo->pointsize=Z_LVAL_PP(entry); + break; + } + case 's': + case 'S': + if (LocaleCompare(key,"stroke") == 0) + { + (void) QueryColorDatabase(Z_STRVAL_PP(entry),&drawinfo->stroke); + break; + } + break; + case 't': + case 'T': + /* no effect yet ..... */ + if (LocaleCompare(key,"text") == 0) + { + CloneString(&drawinfo->text, Z_STRVAL_PP(entry)); + break; + } + break; + + break; + } + zend_hash_move_forward(target_hash); + } +(void) DrawImage(handle->image,drawinfo); + + + + DestroyDrawInfo(drawinfo); + + +} + + + /* {{{ proto void imagick_list_magickinfo(string filename) dumps all known imageformats to a file */ @@ -657,6 +863,10 @@ if (outformat != NULL) { + if (outformat_len > MaxTextExtent-1) { + php_error(E_WARNING, "%s(): Too long format name", get_active_function_name(TSRMLS_C)); + RETURN_FALSE; + } strncpy( handle->image->magick, outformat, MaxTextExtent-1 ); } @@ -774,14 +984,14 @@ MAKE_STD_ZVAL(userdata); if (array_init(userdata) != SUCCESS) { - php_error(E_ERROR,"%s() Problems with creating array",get_active_function_name(TSRMLS_C)); + php_error(E_ERROR,"%s(): Problems with creating array",get_active_function_name(TSRMLS_C)); RETVAL_FALSE; return; } convert_to_string(value); if (add_assoc_string(userdata,attribute,Z_STRVAL_P(value),1) != SUCCESS) { - php_error(E_ERROR,"%s() Problems with adding string to array",get_active_function_name(TSRMLS_C)); + php_error(E_ERROR,"%s(): Problems with adding string to array",get_active_function_name(TSRMLS_C)); RETVAL_FALSE; return; } @@ -836,8 +1046,13 @@ if (LocaleCompare(attribute,"format") == 0) { convert_to_string_ex(entry); - for ( ; image; image=image->next) - strncpy( image->magick, Z_STRVAL_PP(entry), MaxTextExtent-1 ); + if (Z_STRLEN_PP(entry) > MaxTextExtent-1) { + php_error(E_WARNING, "%s(): Too long format name", get_active_function_name(TSRMLS_C)); + } + else { + for ( ; image; image=image->next) + strncpy( image->magick, Z_STRVAL_PP(entry), MaxTextExtent-1 ); + } break; } @@ -846,8 +1061,13 @@ if (LocaleCompare(attribute,"magick") == 0) { convert_to_string_ex(entry); - for ( ; image; image=image->next) - strncpy( image->magick, Z_STRVAL_PP(entry), MaxTextExtent-1 ); + if (Z_STRLEN_PP(entry) > MaxTextExtent-1) { + php_error(E_WARNING, "%s(): Too long magick", get_active_function_name(TSRMLS_C)); + } + else { + for ( ; image; image=image->next) + strncpy( image->magick, Z_STRVAL_PP(entry), MaxTextExtent-1 ); + } break; } case 'q': @@ -899,6 +1119,8 @@ ExceptionInfo exception; + ExceptionInfo *exception_p; + /* mmh, a one way conversion function... no idea how to do that with reusing the other functions... so for the time being, evth is duplicated */ @@ -911,26 +1133,24 @@ return; } - - handle = (php_imagick *)emalloc(sizeof(php_imagick)); + handle = _php_imagick_new(); if (!handle) { - php_error(E_WARNING, "%s() couldn't allocate PHP-Magick handle", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } - memset(handle, 0, sizeof(php_imagick)); - handle->info = CloneImageInfo((ImageInfo *) NULL);; - + if (infile_len > MaxTextExtent-1) { + php_error(E_WARNING, "%s(): Too long format name", get_active_function_name(TSRMLS_C)); + } strncpy( handle->info->filename, infile, MaxTextExtent-1 ); handle->image=ReadImage(handle->info,&exception); if ( handle->image == (Image *)NULL ) { - php_error(E_ERROR,"%s() problem with opening file %s: %s",get_active_function_name(TSRMLS_C), infile,exception.reason); - RETVAL_FALSE; - return; + imagick_warning(); + _php_imagick_free(handle); + RETURN_FALSE; } /* if outfilename = "-" or null, dump it to the browser */ @@ -942,13 +1162,21 @@ } length=0; blob = ImageToBlob ( handle->info,handle->image, &length, &exception ); - php_header(); + + if (blob == NULL) { + imagick_warning(); + RETVAL_FALSE; + } + else { + php_header(); #if APACHE && defined(CHARSET_EBCDIC) - SLS_FETCH(); - /* This is a binary file already: avoid EBCDIC->ASCII conversion */ - ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0); + SLS_FETCH(); + /* This is a binary file already: avoid EBCDIC->ASCII conversion */ + ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0); #endif - php_write(blob, length TSRMLS_CC); + php_write(blob, length TSRMLS_CC); + RETVAL_TRUE; + } } @@ -958,15 +1186,16 @@ er = WriteImage(handle->info,handle->image); if ( er == 0 ) { - php_error(E_ERROR,"%s() problems with saving file %s: %s",get_active_function_name(TSRMLS_C), outfile,handle->image->exception.reason); + exception_p = &(handle->image)->exception; + imagick_warning_p(); RETVAL_FALSE; - return; + } + else { + RETVAL_TRUE; } } - DestroyImageInfo(handle->info); - DestroyImage(handle->image); - RETVAL_TRUE; + _php_imagick_free(handle); } Index: pear/PECL/imagick/imagick.php diff -u pear/PECL/imagick/imagick.php:1.1 pear/PECL/imagick/imagick.php:1.2 --- pear/PECL/imagick/imagick.php:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/imagick.php Tue Dec 4 04:28:54 2001 @@ -22,12 +22,12 @@ if(!extension_loaded('imagick')) { dl('imagick.so'); } - $handle = imagick_create(); -//imagick_set_attribute($handle,"size","100x150"); -print imagick_read($handle,"bla4.png"); + +imagick_set_attribute($handle,"size","500x500"); +imagick_read($handle,"xc:red"); @@ -35,20 +35,30 @@ //print imagick_get_attribute($handle,"height"); //imagick_oilpaint($handle,20); //print imagick_get_attribute($handle,"size"); -print imagick_set_attribute($handle,array("quality"=>1,"magick"=>"JPEG")); - +imagick_set_attribute($handle,array("quality"=>1,"magick"=>"JPEG")); +imagick_annotate($handle,array( +"primitive"=>"text 150,150 hello", + "pointsize"=>60, + "antialias"=>1, + "stroke"=>'green', + "fill"=>'#ff7755', + "font"=>"Arial.ttf", + + "text"=>"doedl", + "rotate"=>90 + )); //imagick_morph($handle,3); -imagick_write($handle,"bla3g.gif"); -imagick_free($handle); +imagick_write($handle,"bla3.png"); +//imagick_free($handle); -header("Content-type: image/gif"); +header("Content-type: image/png"); -readfile("bla3g.gif"); +readfile("bla3.png"); Index: pear/PECL/imagick/package.xml diff -u pear/PECL/imagick/package.xml:1.1 pear/PECL/imagick/package.xml:1.2 --- pear/PECL/imagick/package.xml:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/package.xml Tue Dec 4 04:28:54 2001 @@ -11,11 +11,15 @@ <email>chregu@php.net</email> </maintainer> <release> - <version>0.0.1</version> - <date>2001-11-22</date> + <version>0.0.2</version> + <date>2001-12-04</date> <notes> - - first offical PEAR/PECL release - - a lot of functionality still missing +- added andrei as author +- better config support +- better errorhandling +- support for php < 4.1 +- annotate text function + </notes> </release> <filelist> Index: pear/PECL/imagick/php_imagick.h diff -u pear/PECL/imagick/php_imagick.h:1.1 pear/PECL/imagick/php_imagick.h:1.2 --- pear/PECL/imagick/php_imagick.h:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/php_imagick.h Tue Dec 4 04:28:54 2001 @@ -52,6 +52,7 @@ PHP_FUNCTION(imagick_rotate); PHP_FUNCTION(imagick_shear); PHP_FUNCTION(imagick_oilpaint); +PHP_FUNCTION(imagick_annotate); PHP_FUNCTION(imagick_morph); PHP_FUNCTION(imagick_write); PHP_FUNCTION(imagick_list_magickinfo); @@ -61,10 +62,15 @@ PHP_FUNCTION(imagick_new); PHP_FUNCTION(imagick_convert); PHP_FUNCTION(imagick_free); +PHP_FUNCTION(imagick_init); + + + typedef struct { ImageInfo *info; Image *image; + int count; } php_imagick; /* Index: pear/PECL/imagick/doc/function.imagick-convert.html diff -u pear/PECL/imagick/doc/function.imagick-convert.html:1.1 pear/PECL/imagick/doc/function.imagick-convert.html:1.2 --- pear/PECL/imagick/doc/function.imagick-convert.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/function.imagick-convert.html Tue Dec 4 04:28:54 2001 @@ -78,7 +78,7 @@ ><DIV CLASS="refnamediv" ><A -NAME="AEN690" +NAME="AEN692" ></A ><P > (unknown)</P @@ -88,14 +88,14 @@ ><DIV CLASS="refsect1" ><A -NAME="AEN693" +NAME="AEN695" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A -NAME="AEN695" +NAME="AEN697" ></A ><P ></P Index: pear/PECL/imagick/doc/function.imagick-create.html diff -u pear/PECL/imagick/doc/function.imagick-create.html:1.1 pear/PECL/imagick/doc/function.imagick-create.html:1.2 --- pear/PECL/imagick/doc/function.imagick-create.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/function.imagick-create.html Tue Dec 4 04:28:54 2001 @@ -78,7 +78,7 @@ ><DIV CLASS="refnamediv" ><A -NAME="AEN37" +NAME="AEN39" ></A ><P > (unknown)</P @@ -86,14 +86,14 @@ ><DIV CLASS="refsect1" ><A -NAME="AEN40" +NAME="AEN42" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A -NAME="AEN42" +NAME="AEN44" ></A ><P ></P @@ -160,7 +160,7 @@ ><DIV CLASS="example" ><A -NAME="AEN53" +NAME="AEN55" ></A ><P ><B Index: pear/PECL/imagick/doc/function.imagick-crop.html diff -u pear/PECL/imagick/doc/function.imagick-crop.html:1.1 pear/PECL/imagick/doc/function.imagick-crop.html:1.2 --- pear/PECL/imagick/doc/function.imagick-crop.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/function.imagick-crop.html Tue Dec 4 04:28:54 2001 @@ -78,7 +78,7 @@ ><DIV CLASS="refnamediv" ><A -NAME="AEN718" +NAME="AEN720" ></A ><P > (unknown)</P @@ -88,14 +88,14 @@ ><DIV CLASS="refsect1" ><A -NAME="AEN721" +NAME="AEN723" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A -NAME="AEN723" +NAME="AEN725" ></A ><P ></P Index: pear/PECL/imagick/doc/function.imagick-dump.html diff -u pear/PECL/imagick/doc/function.imagick-dump.html:1.1 pear/PECL/imagick/doc/function.imagick-dump.html:1.2 --- pear/PECL/imagick/doc/function.imagick-dump.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/function.imagick-dump.html Tue Dec 4 04:28:54 2001 @@ -13,8 +13,8 @@ TITLE="Imagick Functions" HREF="ref.imagick.html"><LINK REL="PREVIOUS" -TITLE="imagick_morph" -HREF="function.imagick-morph.html"><LINK +TITLE="imagick_annotate" +HREF="function.imagick-annotate.html"><LINK REL="NEXT" TITLE="imagick_set_attribute" HREF="function.imagick-set-attribute.html"><META @@ -47,7 +47,7 @@ ALIGN="left" VALIGN="bottom" ><A -HREF="function.imagick-morph.html" +HREF="function.imagick-annotate.html" ACCESSKEY="P" >Prev</A ></TD @@ -78,7 +78,7 @@ ><DIV CLASS="refnamediv" ><A -NAME="AEN887" +NAME="AEN912" ></A ><P > (unknown)</P @@ -88,14 +88,14 @@ ><DIV CLASS="refsect1" ><A -NAME="AEN890" +NAME="AEN915" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A -NAME="AEN892" +NAME="AEN917" ></A ><P ></P @@ -168,7 +168,7 @@ ALIGN="left" VALIGN="top" ><A -HREF="function.imagick-morph.html" +HREF="function.imagick-annotate.html" ACCESSKEY="P" >Prev</A ></TD @@ -196,7 +196,7 @@ WIDTH="33%" ALIGN="left" VALIGN="top" ->imagick_morph</TD +>imagick_annotate</TD ><TD WIDTH="34%" ALIGN="center" Index: pear/PECL/imagick/doc/function.imagick-free.html diff -u pear/PECL/imagick/doc/function.imagick-free.html:1.1 pear/PECL/imagick/doc/function.imagick-free.html:1.2 --- pear/PECL/imagick/doc/function.imagick-free.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/function.imagick-free.html Tue Dec 4 04:28:54 2001 @@ -78,7 +78,7 @@ ><DIV CLASS="refnamediv" ><A -NAME="AEN673" +NAME="AEN675" ></A ><P > (unknown)</P @@ -88,14 +88,14 @@ ><DIV CLASS="refsect1" ><A -NAME="AEN676" +NAME="AEN678" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A -NAME="AEN678" +NAME="AEN680" ></A ><P ></P Index: pear/PECL/imagick/doc/function.imagick-get-attribute.html diff -u pear/PECL/imagick/doc/function.imagick-get-attribute.html:1.1 pear/PECL/imagick/doc/function.imagick-get-attribute.html:1.2 --- pear/PECL/imagick/doc/function.imagick-get-attribute.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/function.imagick-get-attribute.html Tue Dec 4 04:28:54 2001 @@ -71,7 +71,7 @@ ><DIV CLASS="refnamediv" ><A -NAME="AEN949" +NAME="AEN974" ></A ><P > (unknown)</P @@ -81,14 +81,14 @@ ><DIV CLASS="refsect1" ><A -NAME="AEN952" +NAME="AEN977" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A -NAME="AEN954" +NAME="AEN979" ></A ><P ></P Index: pear/PECL/imagick/doc/function.imagick-morph.html diff -u pear/PECL/imagick/doc/function.imagick-morph.html:1.1 pear/PECL/imagick/doc/function.imagick-morph.html:1.2 --- pear/PECL/imagick/doc/function.imagick-morph.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/function.imagick-morph.html Tue Dec 4 04:28:54 2001 @@ -16,8 +16,8 @@ TITLE="imagick_shear" HREF="function.imagick-shear.html"><LINK REL="NEXT" -TITLE="imagick_dump" -HREF="function.imagick-dump.html"><META +TITLE="imagick_annotate" +HREF="function.imagick-annotate.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY @@ -61,7 +61,7 @@ ALIGN="right" VALIGN="bottom" ><A -HREF="function.imagick-dump.html" +HREF="function.imagick-annotate.html" ACCESSKEY="N" >Next</A ></TD @@ -78,7 +78,7 @@ ><DIV CLASS="refnamediv" ><A -NAME="AEN869" +NAME="AEN871" ></A ><P > (unknown)</P @@ -88,14 +88,14 @@ ><DIV CLASS="refsect1" ><A -NAME="AEN872" +NAME="AEN874" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A -NAME="AEN874" +NAME="AEN876" ></A ><P ></P @@ -105,7 +105,7 @@ CLASS="FUNCDEF" >bool <B CLASS="function" ->imagick_shear</B +>imagick_morph</B ></CODE > (resource imagick_handle, long number_frames)</CODE ></P @@ -183,7 +183,7 @@ ALIGN="right" VALIGN="top" ><A -HREF="function.imagick-dump.html" +HREF="function.imagick-annotate.html" ACCESSKEY="N" >Next</A ></TD @@ -207,7 +207,7 @@ WIDTH="33%" ALIGN="right" VALIGN="top" ->imagick_dump</TD +>imagick_annotate</TD ></TR ></TABLE ></DIV Index: pear/PECL/imagick/doc/function.imagick-read.html diff -u pear/PECL/imagick/doc/function.imagick-read.html:1.1 pear/PECL/imagick/doc/function.imagick-read.html:1.2 --- pear/PECL/imagick/doc/function.imagick-read.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/function.imagick-read.html Tue Dec 4 04:28:54 2001 @@ -78,7 +78,7 @@ ><DIV CLASS="refnamediv" ><A -NAME="AEN60" +NAME="AEN62" ></A ><P > (unknown)</P @@ -86,14 +86,14 @@ ><DIV CLASS="refsect1" ><A -NAME="AEN63" +NAME="AEN65" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A -NAME="AEN65" +NAME="AEN67" ></A ><P ></P @@ -176,7 +176,7 @@ >&#13; <DIV CLASS="table" ><A -NAME="AEN83" +NAME="AEN85" ></A ><P ><B @@ -2100,7 +2100,7 @@ ><DIV CLASS="example" ><A -NAME="AEN628" +NAME="AEN630" ></A ><P ><B @@ -2145,7 +2145,7 @@ ><DIV CLASS="example" ><A -NAME="AEN633" +NAME="AEN635" ></A ><P ><B Index: pear/PECL/imagick/doc/function.imagick-resize.html diff -u pear/PECL/imagick/doc/function.imagick-resize.html:1.1 pear/PECL/imagick/doc/function.imagick-resize.html:1.2 --- pear/PECL/imagick/doc/function.imagick-resize.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/function.imagick-resize.html Tue Dec 4 04:28:54 2001 @@ -78,7 +78,7 @@ ><DIV CLASS="refnamediv" ><A -NAME="AEN769" +NAME="AEN771" ></A ><P > (unknown)</P @@ -88,14 +88,14 @@ ><DIV CLASS="refsect1" ><A -NAME="AEN772" +NAME="AEN774" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A -NAME="AEN774" +NAME="AEN776" ></A ><P ></P Index: pear/PECL/imagick/doc/function.imagick-rotate.html diff -u pear/PECL/imagick/doc/function.imagick-rotate.html:1.1 pear/PECL/imagick/doc/function.imagick-rotate.html:1.2 --- pear/PECL/imagick/doc/function.imagick-rotate.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/function.imagick-rotate.html Tue Dec 4 04:28:54 2001 @@ -78,7 +78,7 @@ ><DIV CLASS="refnamediv" ><A -NAME="AEN831" +NAME="AEN833" ></A ><P > (unknown)</P @@ -88,14 +88,14 @@ ><DIV CLASS="refsect1" ><A -NAME="AEN834" +NAME="AEN836" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A -NAME="AEN836" +NAME="AEN838" ></A ><P ></P Index: pear/PECL/imagick/doc/function.imagick-sample.html diff -u pear/PECL/imagick/doc/function.imagick-sample.html:1.1 pear/PECL/imagick/doc/function.imagick-sample.html:1.2 --- pear/PECL/imagick/doc/function.imagick-sample.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/function.imagick-sample.html Tue Dec 4 04:28:54 2001 @@ -78,7 +78,7 @@ ><DIV CLASS="refnamediv" ><A -NAME="AEN744" +NAME="AEN746" ></A ><P > (unknown)</P @@ -88,14 +88,14 @@ ><DIV CLASS="refsect1" ><A -NAME="AEN747" +NAME="AEN749" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A -NAME="AEN749" +NAME="AEN751" ></A ><P ></P Index: pear/PECL/imagick/doc/function.imagick-set-attribute.html diff -u pear/PECL/imagick/doc/function.imagick-set-attribute.html:1.1 pear/PECL/imagick/doc/function.imagick-set-attribute.html:1.2 --- pear/PECL/imagick/doc/function.imagick-set-attribute.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/function.imagick-set-attribute.html Tue Dec 4 04:28:54 2001 @@ -78,7 +78,7 @@ ><DIV CLASS="refnamediv" ><A -NAME="AEN907" +NAME="AEN932" ></A ><P > (unknown)</P @@ -88,14 +88,14 @@ ><DIV CLASS="refsect1" ><A -NAME="AEN910" +NAME="AEN935" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A -NAME="AEN912" +NAME="AEN937" ></A ><P ></P @@ -105,7 +105,7 @@ CLASS="FUNCDEF" >bool <B CLASS="function" ->imagick_sample</B +>imagick_set_attribute</B ></CODE > (resource imagick_handle, mixed attribute [, string attribute_value])</CODE ></P @@ -213,7 +213,7 @@ ><DIV CLASS="example" ><A -NAME="AEN938" +NAME="AEN963" ></A ><P ><B @@ -256,7 +256,7 @@ ><DIV CLASS="example" ><A -NAME="AEN942" +NAME="AEN967" ></A ><P ><B Index: pear/PECL/imagick/doc/function.imagick-shear.html diff -u pear/PECL/imagick/doc/function.imagick-shear.html:1.1 pear/PECL/imagick/doc/function.imagick-shear.html:1.2 --- pear/PECL/imagick/doc/function.imagick-shear.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/function.imagick-shear.html Tue Dec 4 04:28:54 2001 @@ -78,7 +78,7 @@ ><DIV CLASS="refnamediv" ><A -NAME="AEN849" +NAME="AEN851" ></A ><P > (unknown)</P @@ -88,14 +88,14 @@ ><DIV CLASS="refsect1" ><A -NAME="AEN852" +NAME="AEN854" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A -NAME="AEN854" +NAME="AEN856" ></A ><P ></P Index: pear/PECL/imagick/doc/function.imagick-write.html diff -u pear/PECL/imagick/doc/function.imagick-write.html:1.1 pear/PECL/imagick/doc/function.imagick-write.html:1.2 --- pear/PECL/imagick/doc/function.imagick-write.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/function.imagick-write.html Tue Dec 4 04:28:54 2001 @@ -78,7 +78,7 @@ ><DIV CLASS="refnamediv" ><A -NAME="AEN641" +NAME="AEN643" ></A ><P > (unknown)</P @@ -88,14 +88,14 @@ ><DIV CLASS="refsect1" ><A -NAME="AEN644" +NAME="AEN646" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A -NAME="AEN646" +NAME="AEN648" ></A ><P ></P @@ -184,7 +184,7 @@ ><DIV CLASS="example" ><A -NAME="AEN664" +NAME="AEN666" ></A ><P ><B Index: pear/PECL/imagick/doc/function.list-magickinfo.html diff -u pear/PECL/imagick/doc/function.list-magickinfo.html:1.1 pear/PECL/imagick/doc/function.list-magickinfo.html:1.2 --- pear/PECL/imagick/doc/function.list-magickinfo.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/function.list-magickinfo.html Tue Dec 4 04:28:54 2001 @@ -78,7 +78,7 @@ ><DIV CLASS="refnamediv" ><A -NAME="AEN816" +NAME="AEN818" ></A ><P > (unknown)</P @@ -88,14 +88,14 @@ ><DIV CLASS="refsect1" ><A -NAME="AEN819" +NAME="AEN821" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A -NAME="AEN821" +NAME="AEN823" ></A ><P ></P Index: pear/PECL/imagick/doc/ref.imagick.html diff -u pear/PECL/imagick/doc/ref.imagick.html:1.1 pear/PECL/imagick/doc/ref.imagick.html:1.2 --- pear/PECL/imagick/doc/ref.imagick.html:1.1 Thu Nov 22 12:25:08 2001 +++ pear/PECL/imagick/doc/ref.imagick.html Tue Dec 4 04:28:54 2001 @@ -175,11 +175,15 @@ ><TBODY ><TR ><TD ->- untar the imagick.tgz archive into php4/ext (available from <A +>- untar the imagick.tgz archive into php4/ext (cvs-snapshot available from <A HREF="http://pear.chregu.tv/imagick.tgz" TARGET="_top" >http://pear.chregu.tv/imagick.tgz</A ->)</TD +>, released versions are available from <A +HREF="http://pear.chregu.tv/" +TARGET="_top" +>http://pear.chregu.tv/</A +>. Look there for pecl_imagick-x.y.z.tgz)</TD ></TR ><TR ><TD @@ -219,7 +223,17 @@ >Contact Information</A ></H2 ><P ->&#13;If you have comments, bugfixes, enhancements or want to help developping this beast, +>&#13;I have at the moment not very much time to further develop this extension. I will +implement more and more features in the near future, but don't expect a full-featured extension +soon. If you can't wait, you are very welcome to implement some of the features. It's +really not very hard. Just have a look at the source-code. +Or let me know, which ImageMagick feature you urgently need, and maybe +I will implement that first ... +</P +><P +>&#13; + +If you have comments, bugfixes, enhancements or want to help developping this beast, you can drop me a mail at <A HREF="mailto:chregu@php.net" @@ -322,6 +336,13 @@ >imagick_morph</A >&nbsp;--&nbsp; Morphes at least 2 pictures + </DT +><DT +><A +HREF="function.imagick-annotate.html" +>imagick_annotate</A +>&nbsp;--&nbsp; + Annotates an image with a text </DT ><DT ><A Index: pear/PECL/imagick/xml/imagick.xml diff -u pear/PECL/imagick/xml/imagick.xml:1.2 pear/PECL/imagick/xml/imagick.xml:1.3 --- pear/PECL/imagick/xml/imagick.xml:1.2 Thu Nov 22 14:10:44 2001 +++ pear/PECL/imagick/xml/imagick.xml Tue Dec 4 04:28:54 2001 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <reference id="ref.imagick"> <title>Imagick Functions</title> <titleabbrev>imagick</titleabbrev> @@ -31,7 +31,7 @@ <para> short installation note: <simplelist> -<member>- untar the imagick.tgz archive into php4/ext (available from <ulink url="http://pear.chregu.tv/imagick.tgz">http://pear.chregu.tv/imagick.tgz</ulink>)</member> +<member>- untar the imagick.tgz archive into php4/ext (cvs-snapshot available from <ulink url="http://pear.chregu.tv/imagick.tgz">http://pear.chregu.tv/imagick.tgz</ulink>, released versions are available from <ulink url="http://pear.chregu.tv/">http://pear.chregu.tv/</ulink>. Look there for pecl_imagick-x.y.z.tgz)</member> <member>- run phpize in ext/imagick</member> <member>- run ./buildconf in php4</member> <member>- run configure with --with-imagick (and your other options)</member> @@ -46,6 +46,16 @@ <sect2 id="imagick.contact"> <title>Contact Information</title> <para> +I have at the moment not very much time to further develop this extension. I will +implement more and more features in the near future, but don't expect a full-featured extension +soon. If you can't wait, you are very welcome to implement some of the features. It's +really not very hard. Just have a look at the source-code. +Or let me know, which ImageMagick feature you urgently need, and maybe +I will implement that first ... +</para> +<para> + + If you have comments, bugfixes, enhancements or want to help developping this beast, you can drop me a mail at <ulink url="mailto:chregu@php.net">chregu@php.net</ulink> or @@ -644,7 +654,7 @@ <title>Description</title> <funcsynopsis> <funcprototype> - <funcdef>bool <function>imagick_shear</function></funcdef> + <funcdef>bool <function>imagick_morph</function></funcdef> <paramdef>resource <parameter>imagick_handle</parameter></paramdef> <paramdef>long <parameter>number_frames</parameter></paramdef> </funcprototype> @@ -659,6 +669,50 @@ </refsect1> </refentry> + + <refentry id="function.imagick-annotate"> + <refnamediv> + <refname>imagick_annotate</refname> + <refpurpose> + Annotates an image with a text + </refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>bool <function>imagick_annotate</function></funcdef> + <paramdef>resource <parameter>imagick_handle</parameter></paramdef> + <paramdef>array <parameter>options</parameter></paramdef> + </funcprototype> + </funcsynopsis> + &warn.experimental.func; + <para> +This function can be used to draw a text on an image. See the example. + </para> + <para> + <example> + <title><function>imagick_annotate</function> example</title> + <programlisting role="php"> +<![CDATA[ + +imagick_annotate($handle,array( + "primitive"=>"text 150,150 hello world", + "pointsize"=>60, + "antialias"=>1, + "stroke"=>'green', + "fill"=>'#ff7755', + "font"=>"Arial.ttf", + "rotate"=>90 + )); +?> +]]> + </programlisting> + </example> +</para> + </refsect1> + </refentry> + <refentry id="function.imagick-dump"> Index: pear/PECL/imagick/doc/function.imagick-annotate.html +++ pear/PECL/imagick/doc/function.imagick-annotate.html <HTML ><HEAD ><TITLE >imagick_annotate</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.73 "><LINK REL="HOME" TITLE="imagick Manual;" HREF="index.html"><LINK REL="UP" TITLE="Imagick Functions" HREF="ref.imagick.html"><LINK REL="PREVIOUS" TITLE="imagick_morph" HREF="function.imagick-morph.html"><LINK REL="NEXT" TITLE="imagick_dump" HREF="function.imagick-dump.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >imagick Manual;</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.imagick-morph.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.imagick-dump.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.imagick-annotate" >imagick_annotate</A ></H1 ><DIV CLASS="refnamediv" ><A NAME="AEN889" ></A ><P > (unknown)</P >imagick_annotate&nbsp;--&nbsp; Annotates an image with a text </DIV ><DIV CLASS="refsect1" ><A NAME="AEN892" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><A NAME="AEN894" ></A ><P ></P ><P ><CODE ><CODE CLASS="FUNCDEF" >bool <B CLASS="function" >imagick_annotate</B ></CODE > (resource imagick_handle, array options)</CODE ></P ><P ></P ></DIV ><DIV CLASS="warning" ><P ></P ><TABLE CLASS="warning" BORDER="1" WIDTH="100%" ><TR ><TD ALIGN="CENTER" ><B >Warning</B ></TD ></TR ><TR ><TD ALIGN="LEFT" ><P >This function is <SPAN CLASS="emphasis" ><I CLASS="emphasis" >EXPERIMENTAL</I ></SPAN >. That means, that the behaviour of this function, this function name, in concreto ANYTHING documented here can change in a future release of PHP WITHOUT NOTICE. Be warned, and use this function at your own risk.</P ></TD ></TR ></TABLE ></DIV ><P >&#13;This function can be used to draw a text on an image. See the example. </P ><P >&#13; <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN907" ></A ><P ><B >Example 1. <B CLASS="function" >imagick_annotate()</B > example</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="php" >imagick_annotate($handle,array( "primitive"=&#62;"text 150,150 hello world", "pointsize"=&#62;60, "antialias"=&#62;1, "stroke"=&#62;'green', "fill"=&#62;'#ff7755', "font"=&#62;"Arial.ttf", "rotate"=&#62;90 )); ?&#62;</PRE ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.imagick-morph.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.imagick-dump.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >imagick_morph</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.imagick.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >imagick_dump</TD ></TR ></TABLE ></DIV ></BODY ></HTML >
« previous php.pear.cvs (#1461) next »