cvs: pear /PECL/imagick imagick.c

From: Date: Wed, 28 Aug 2002 01:31:28 +0000
Subject: cvs: pear /PECL/imagick imagick.c
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-6022@lists.php.net to get a copy of this message
pajoye Tue Aug 27 21:31:28 2002 EDT Modified files: /pear/PECL/imagick imagick.c Log: Fix color for imagick_frame() Index: pear/PECL/imagick/imagick.c diff -u pear/PECL/imagick/imagick.c:1.8 pear/PECL/imagick/imagick.c:1.9 --- pear/PECL/imagick/imagick.c:1.8 Tue Aug 27 21:14:47 2002 +++ pear/PECL/imagick/imagick.c Tue Aug 27 21:31:28 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: imagick.c,v 1.8 2002/08/28 01:14:47 pajoye Exp $ */ +/* $Id: imagick.c,v 1.9 2002/08/28 01:31:28 pajoye Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -809,6 +809,7 @@ rect->height = height; rect->x = 0; rect->y = 0; + copy_handle->image = BorderImage(handle->image,rect,&exception); efree(rect); @@ -833,7 +834,7 @@ char * color = NULL; char * color_len = 0; - const char * default_color = "#ff0000"; + //const char * default_color = "#ff0000"; int argc = ZEND_NUM_ARGS(); @@ -852,23 +853,29 @@ } IMAGICK_FETCH_RES_AND_COPY_HANDLE(); - // Does not set the matte_color - // someone can try to fix it? - if( QueryColorDatabase(color, &handle->info->matte_color,&exception) ){ - frame = (FrameInfo *)emalloc(sizeof(FrameInfo)); + // Damned stupid properties + if( color_len>0 ){ + (void)QueryColorDatabase(color, &handle->info->matte_color,&exception); + (void)QueryColorDatabase(color, &handle->image->matte_color,&exception); + } + + frame = (FrameInfo *)emalloc(sizeof(FrameInfo)); + if( frame==(FrameInfo *)NULL ){ + RETURN_FALSE; + } else { frame->width = handle->image->columns+(width*2); frame->height = handle->image->rows+(width*2); frame->x = width; frame->y = width; frame->inner_bevel = inner_bevel; frame->outer_bevel = outer_bevel; - copy_handle->image = FrameImage(handle->image,frame,&exception); efree(frame); - //efree(color_index); + GetExceptionInfo(&exception); + if(copy_handle->image==(Image *)NULL){ + RETURN_FALSE; + } IMAGICK_RET_COPY_HANDLE(); - } else { - RETURN_FALSE; } } /* }}} */ @@ -893,7 +900,7 @@ IMAGICK_FETCH_RES_AND_COPY_HANDLE(); copy_handle->image = RotateImage(handle->image,degrees,&exception); - + GetExceptionInfo(&exception); IMAGICK_RET_COPY_HANDLE(); } /* }}} */

« previous php.pear.cvs (#6022) next »