Ejemplo n.º 1
0
    // can result in image going too far off on Y-axis;
    // not much I can do about that, apart from make image bigger
    // again, I wish I could do 1.5 pixels
    $y_pos += $rand_func(-1, 1);
    ImageCopy($im, $im2, $i, $y_pos, $i, 0, $x_chunk, $height);
    // for debug:
    //ImageLine($im,$i+$x_chunk,0,$i+$x_chunk,100,$debug);
    //ImageLine($im,$i,$y_pos+25,$i+$x_chunk,$y_pos+25,$debug);
}
// for debug:
//sendImage($im);
// blur edges:
// doesn't really add any security, but looks a lot nicer, and renders text a little easier to read
// for humans (hopefully not for OCRs, but if you know better, feel free to disable this function)
// (and if you do, let me know why)
myImageBlur($im);
// for debug:
//sendImage($im);
if ($output != "jpg" && $bg_type == 0) {
    // make background transparent
    ImageColorTransparent($im, $bg);
}
//////////////////////////////////////////////////////
////// Try to avoid 'free p*rn' style CAPTCHA re-use
//////////////////////////////////////////////////////
// ('*'ed to stop my site coming up for certain keyword searches on google)
// can obscure CAPTCHA word in some cases..
// write site tags 'shining through' the morphed image
ImageFilledRectangle($im2, 0, 0, $width, $height, $bg2);
if (is_array($site_tags)) {
    for ($i = 0; $i < sizeof($site_tags); $i++) {
Ejemplo n.º 2
0
    // can result in image going too far off on Y-axis;
    // not much I can do about that, apart from make image bigger
    // again, I wish I could do 1.5 pixels
    $y_pos += $GLOBALS['rand_func'](-1, 1);
    ImageCopy($GLOBALS['im1'], $GLOBALS['im2'], $i, $y_pos, $i, 0, $x_chunk, $height);
    // for debug:
    //ImageLine($GLOBALS['im1'],$i+$x_chunk,0,$i+$x_chunk,100,$debug);
    //ImageLine($GLOBALS['im1'],$i,$y_pos+25,$i+$x_chunk,$y_pos+25,$debug);
}
// for debug:
//sendImage($GLOBALS['im1']);
// blur edges:
// doesn't really add any security, but looks a lot nicer, and renders text a little easier to read
// for humans (hopefully not for OCRs, but if you know better, feel free to disable this function)
// (and if you do, let me know why)
myImageBlur($GLOBALS['im1']);
// for debug:
//sendImage($GLOBALS['im1']);
if ($GLOBALS['output'] != "jpg" && $GLOBALS['bg_type'] == 0) {
    // make background transparent
    ImageColorTransparent($GLOBALS['im1'], $bg1);
}
//////////////////////////////////////////////////////
////// Try to avoid 'free p*rn' style CAPTCHA re-use
//////////////////////////////////////////////////////
// ('*'ed to stop my site coming up for certain keyword searches on google)
// can obscure CAPTCHA word in some cases..
// write site tags 'shining through' the morphed image
ImageFilledRectangle($GLOBALS['im2'], 0, 0, $width, $height, $bg2);
if (is_array($site_tags)) {
    for ($i = 0; $i < sizeof($site_tags); $i++) {