includes/captcha/engine_freecap.php
changeset 558 fd082123f2f4
parent 401 6ae6e387a0e3
child 1227 bdac73ed481e
equal deleted inserted replaced
557:26479224936a 558:fd082123f2f4
   386       $temp_bg = ImageCreateTrueColor($width*1.5,$height*1.5);
   386       $temp_bg = ImageCreateTrueColor($width*1.5,$height*1.5);
   387       $bg3 = ImageColorAllocate($this->im3,255,255,255);
   387       $bg3 = ImageColorAllocate($this->im3,255,255,255);
   388       ImageFill($this->im3,0,0,$bg3);
   388       ImageFill($this->im3,0,0,$bg3);
   389       $temp_bg_col = ImageColorAllocate($temp_bg,255,255,255);
   389       $temp_bg_col = ImageColorAllocate($temp_bg,255,255,255);
   390       ImageFill($temp_bg,0,0,$temp_bg_col);
   390       ImageFill($temp_bg,0,0,$temp_bg_col);
   391     
   391       
   392       // we draw all noise onto temp_bg
   392       // we draw all noise onto temp_bg
   393       // then if we're morphing, merge from temp_bg to im3
   393       // then if we're morphing, merge from temp_bg to im3
   394       // or if not, just copy a $widthx$height portion of $temp_bg to $this->im3
   394       // or if not, just copy a $widthx$height portion of $temp_bg to $this->im3
   395       // temp_bg is much larger so that when morphing, the edges retain the noise.
   395       // temp_bg is much larger so that when morphing, the edges retain the noise.
   396     
   396     
   457           // read each image and its size
   457           // read each image and its size
   458           $temp_im[$i] = ImageCreateFromJPEG($this->bg_images[$i]);
   458           $temp_im[$i] = ImageCreateFromJPEG($this->bg_images[$i]);
   459           $temp_width[$i] = imagesx($temp_im[$i]);
   459           $temp_width[$i] = imagesx($temp_im[$i]);
   460           $temp_height[$i] = imagesy($temp_im[$i]);
   460           $temp_height[$i] = imagesy($temp_im[$i]);
   461         }
   461         }
   462     
   462         
   463         $blocksize = $this->rand_func(20,60);
   463         $blocksize = $this->rand_func(20,60);
   464         for($i=0 ; $i<$width*2 ; $i+=$blocksize)
   464         for($i=0 ; $i<$width*2 ; $i+=$blocksize)
   465         {
   465         {
   466           // could randomise blocksize here... hardly matters
   466           // could randomise blocksize here... hardly matters
   467           for($j=0 ; $j<$height*2 ; $j+=$blocksize)
   467           for($j=0 ; $j<$height*2 ; $j+=$blocksize)