Changeset 534 for ImageMagick/trunk

Show
Ignore:
Timestamp:
11/03/09 23:28:07 (3 weeks ago)
Author:
anthony
Message:

Bug fixes for polynomial distort

Location:
ImageMagick/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • ImageMagick/trunk/ChangeLog

    r514 r534  
     12009-11-04  6.5.7-5 Anthony Thyssen <A.Thyssen@griffith...> 
     2  * Bug Fix for Polynomial distortion. which is now working. 
     3 
    142009-11-01  6.5.7-4 Cristy  <quetzlzacatenango@image...> 
    25  * Use -define delegate:bimodal=true to activate any bimodal delegates. 
  • ImageMagick/trunk/magick/distort.c

    r532 r534  
    349349    fall back to Affine distortion (allowing 0 to 3 point pairs) 
    350350  */ 
    351   if ( number_arguments < 4*cp_size && 
     351  if ( number_arguments < 4*cp_size &&  
    352352       (  *method == BilinearForwardDistortion 
    353353       || *method == BilinearReverseDistortion 
     
    376376        (void) ThrowMagickException(exception,GetMagickModule(),OptionError, 
    377377                   "InvalidArgument","%s : '%s'","Polynomial", 
    378                    "Invalid order, should be 1 to 5, or 1.5"); 
     378                   "Invalid order, should be interger 1 to 5, or 1.5"); 
    379379        return((double *) NULL); 
    380380      } 
     
    733733        status; 
    734734 
     735      if ( number_arguments%cp_size != 0 || 
     736           number_arguments < cp_size*4 ) { 
     737        (void) ThrowMagickException(exception,GetMagickModule(),OptionError, 
     738               "InvalidArgument", "%s : 'require at least %ld CPs'", 
     739               "Perspective", 4L); 
     740        coeff=(double *) RelinquishMagickMemory(coeff); 
     741        return((double *) NULL); 
     742      } 
    735743      /* fake 1x8 vectors matrix directly using the coefficients array */ 
    736744      vectors[0] = &(coeff[0]); 
     
    840848        status; 
    841849 
     850      /* check the number of arguments */ 
     851      if ( number_arguments%cp_size != 0 || 
     852           number_arguments < cp_size*4 ) { 
     853        (void) ThrowMagickException(exception,GetMagickModule(),OptionError, 
     854               "InvalidArgument", "%s : 'require at least %ld CPs'", 
     855               *method == BilinearForwardDistortion ? "BilinearForward" : 
     856               "BilinearReverse", 4L); 
     857        coeff=(double *) RelinquishMagickMemory(coeff); 
     858        return((double *) NULL); 
     859      } 
    842860      /* create matrix, and a fake vectors matrix */ 
    843861      matrix = AcquireMagickMatrix(4UL,4UL); 
     
    10031021        vectors[i] = &(coeff[2+i*nterms]); 
    10041022      /* Add given control point pairs for least squares solving */ 
    1005       for (i=0; i < number_arguments; i+=cp_size) { 
     1023      for (i=1; i < number_arguments; i+=cp_size) { /* NB: start = 1 not 0 */ 
    10061024        for (j=0; j < (long) nterms; j++) 
    10071025          terms[j] = poly_basis_fn(j,arguments[i+cp_x],arguments[i+cp_y]);