| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [1998-02-06 05:24 UTC] ssb
  [2020-02-05 10:04 UTC] nikic@php.net
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 05:00:01 2025 UTC | 
Instead of returning a pointer to the newly created image, ImageCopyResized returns TRUE. Make these changes in gd.c, recompile, and everything works fine again: void php3_imagecopyresized(INTERNAL_FUNCTION_PARAMETERS) { YYSTYPE *SIM, *DIM, *SX, *SY, *SW, *SH, *DX, *DY, *DW, *DH; /**** new var ******* int ind; ********************/ gdImagePtr im_dst; gdImagePtr im_src; int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX; int ind_type; GD_TLS_VARS; if (ARG_COUNT(ht) != 10 || getParameters(ht, 10, &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(SIM); convert_to_long(DIM); convert_to_long(SX); convert_to_long(SY); convert_to_long(SW); convert_to_long(SH); convert_to_long(DX); convert_to_long(DY); convert_to_long(DW); convert_to_long(DH); srcX = SX->value.lval; srcY = SY->value.lval; srcH = SH->value.lval; srcW = SW->value.lval; dstX = DX->value.lval; dstY = DY->value.lval; dstH = DH->value.lval; dstW = DW->value.lval; im_src = php3_list_find(SIM->value.lval, &ind_type); if(!im_src || ind_type != GD_GLOBAL(le_gd)) { php3_error(E_WARNING, "Unable to find source image pointer"); RETURN_FALSE; } im_dst = php3_list_find(DIM->value.lval, &ind_type); if(!im_dst || ind_type != GD_GLOBAL(le_gd)) { php3_error(E_WARNING, "Unable to find destination image pointer" ); RETURN_FALSE; } gdImageCopyResized(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); /******* WRONG RETURN VALUE ******** // RETURN_TRUE; ***********************************/ /******* Add these lines *********** ind = php3_list_insert(im_dst, GD_GLOBAL(le_gd)); RETURN_LONG(ind); ***********************************/ }