Kod
GD Support enabled
GD Version 1.6.2 or higher
FreeType Support enabled
FreeType Linkage with TTF library
JPG Support enabled
PNG Support enabled
WBMP Support enabled
GD Version 1.6.2 or higher
FreeType Support enabled
FreeType Linkage with TTF library
JPG Support enabled
PNG Support enabled
WBMP Support enabled
Problem jest gdy wrzuce go na serwer rowniez z GD
Kod
GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
I szukam przyczyny dlaczgo pod windows obraz wyswietla sie, natomiast na serwerze nie. Czy w wersji 2.0 ktora jest na serwerze sa nieaktualne niektore funkcje z tego skryptu ?
<?php // Image should expire immediately // Gather request id from querystring // Connect database and get the number to be displayed //Construct SQL $sql = \"SELECT auth_code FROM auth_code WHERE request_id='$request_id'\"; // Really got such request id or someone having fun? $error_msg='Nie znaleziono takiego ID'; } else { } // Variables ////////////////////////////////////////////////////////////////////////// $x = 100; // Image width $y = 30; // Image height $freq=20; // Number of noise dots $noise_method=\"line\"; // line | dots | rectangle $font_selection = \"random\"; // random | fixed $font_folder = \"\"; // Path to fonts folder $default_font = 4; // Array index of default font in $fonts array. $angle_selection = \"random\"; // random | fixed $max_angle = 10; // Max angle $default_angle = 0; // Default angle. $font_size = 27; // Font size in points ////////////////////////////////////////////////////////////////////////// // Set font $font = \"arial.ttf\"; // Set Text Angle if ($angle_selection==\"random\") { } else { $angle = $default_angle; } // Create image with specified size. // Allocate colors $black = ImageColorAllocate($img, 0, 0, 0); $white = ImageColorAllocate($img, 255, 255, 255); /* Get background , noise and font color randomly from get_random_colors() function. This function returns contrary colors for readability.*/ function get_random_colors() { // $bck = array of background (R,G,B) values // $dot = array of noise (R,G,B) values // $txt = array of text (R,G,B) values // i=O =>Red | i=1 =>Green | i=2 =>Blue for ($i=0; $i<3; $i++) { } // Return array of 3 arrays : [0..2, 0..2] } $rnd_col = get_random_colors(); $background = ImageColorAllocate($img, $rnd_col[0][0], $rnd_col[0][1], $rnd_col[0][2]); $dots_color = ImageColorAllocate($img, $rnd_col[1][0], $rnd_col[1][1], $rnd_col[1][2]); $text_color = ImageColorAllocate($img, $rnd_col[2][0], $rnd_col[2][1], $rnd_col[2][2]); // Stop execution if any error occured before //Fill image background with white ImageFill ($img, 100, 50, $white); //Display error ImageString($img, 2, 20, 10, $error_msg, $black); } else { //Fill image with background color ImageFill ($img, 100, 50, $background); // Add centered text $arr=ImageTtfbBox($font_size, $angle, $font, $number); ImageTTFText($img, $font_size, $angle, $text_x, $text_y - $arr[5], $text_color, $font, $number); $i=0; //<---------Noise Counter // Add Noise Points while ($i < $freq) { switch ($noise_method) { case \"line\": // Draw horizontal line ImageLine($img, $dotX, $dotY, $dotX+$line_width, $dotY, $dots_color); } else { // Draw vertical line ImageLine($img, $dotX, $dotY, $dotX, $dotY+$line_width, $dots_color); } break; case \"dots\": ImageSetPixel($img, $dotX, $dotY, $dots_color); break; case \"rectangle\": ImageRectangle($img, $dotX-1, $dotY-1, $dotX+1, $dotY+1, $dots_color); break; } $i++; } } //Finalize the image. Free memory ImagePNG($img); ImageDestroy($img); ?>