log błedów
http://www.kuklik.linuxpl.info/Galeria/vie....php?imageid=94
[Fri Jan 18 12:11:17 2013] [warn] [client 89.228.68.84] mod_fcgid: stderr: PHP Warning: imagecreatefromjpeg() [<a href='function.imagecreatefromjpeg'>function.imagecreatefromjpeg</a>]: gd-jpeg: JPEG library reports unrecoverable error: in /home/kuklik/domains/kuklik.linuxpl.info/public_html/Galeria/generators/preview.php on line 56, referer: http://www.kuklik.linuxpl.info/Galeria/vie....php?imageid=94
[Fri Jan 18 12:11:17 2013] [warn] [client 89.228.68.84] mod_fcgid: stderr: PHP Warning: imagecreatefromjpeg() [<a href='function.imagecreatefromjpeg'>function.imagecreatefromjpeg</a>]: '/tmp/klNbis' is not a valid JPEG file in /home/kuklik/domains/kuklik.linuxpl.info/public_html/Galeria/generators/preview.php on line 56, referer: http://www.kuklik.linuxpl.info/Galeria/vie....php?imageid=94
[Fri Jan 18 12:11:17 2013] [warn] [client 89.228.68.84] mod_fcgid: stderr: PHP Warning: imagecreatetruecolor() [<a href='function.imagecreatetruecolor'>function.imagecreatetruecolor</a>]: Invalid image dimensions in /home/kuklik/domains/kuklik.linuxpl.info/public_html/Galeria/generators/preview.php on line 57, referer: http://www.kuklik.linuxpl.info/Galeria/vie....php?imageid=94
[Fri Jan 18 12:11:17 2013] [warn] [client 89.228.68.84] mod_fcgid: stderr: PHP Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /home/kuklik/domains/kuklik.linuxpl.info/public_html/Galeria/generators/preview.php on line 58, referer: http://www.kuklik.linuxpl.info/Galeria/vie....php?imageid=94
[Fri Jan 18 12:11:17 2013] [warn] [client 89.228.68.84] mod_fcgid: stderr: PHP Warning: Cannot modify header information - headers already sent by (output started at /home/kuklik/domains/kuklik.linuxpl.info/public_html/Galeria/generators/preview.php:24) in /home/kuklik/domains/kuklik.linuxpl.info/public_html/Galeria/generators/preview.php on line 61, referer: http://www.kuklik.linuxpl.info/Galeria/vie....php?imageid=94
[Fri Jan 18 12:11:17 2013] [warn] [client 89.228.68.84] mod_fcgid: stderr: PHP Warning: imagejpeg() expects parameter 1 to be resource, boolean given in /home/kuklik/domains/kuklik.linuxpl.info/public_html/Galeria/generators/preview.php on line 62, referer: http://www.kuklik.linuxpl.info/Galeria/vie....php?imageid=94
">
[Fri Jan 18 12:11:17 2013] [warn] [client 89.228.68.84] mod_fcgid: stderr: PHP Warning: file_get_contents(http://www.kuklik.linuxpl.info/Galeria/generators/original.php?imageid=94) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! in /home/kuklik/domains/kuklik.linuxpl.info/public_html/Galeria/generators/preview.php on line 24, referer: http://www.kuklik.linuxpl.info/Galeria/vie....php?imageid=94
[Fri Jan 18 12:11:17 2013] [warn] [client 89.228.68.84] mod_fcgid: stderr: PHP Warning: imagecreatefromjpeg() [<a href='function.imagecreatefromjpeg'>function.imagecreatefromjpeg</a>]: gd-jpeg: JPEG library reports unrecoverable error: in /home/kuklik/domains/kuklik.linuxpl.info/public_html/Galeria/generators/preview.php on line 56, referer: http://www.kuklik.linuxpl.info/Galeria/vie....php?imageid=94
[Fri Jan 18 12:11:17 2013] [warn] [client 89.228.68.84] mod_fcgid: stderr: PHP Warning: imagecreatefromjpeg() [<a href='function.imagecreatefromjpeg'>function.imagecreatefromjpeg</a>]: '/tmp/klNbis' is not a valid JPEG file in /home/kuklik/domains/kuklik.linuxpl.info/public_html/Galeria/generators/preview.php on line 56, referer: http://www.kuklik.linuxpl.info/Galeria/vie....php?imageid=94
[Fri Jan 18 12:11:17 2013] [warn] [client 89.228.68.84] mod_fcgid: stderr: PHP Warning: imagecreatetruecolor() [<a href='function.imagecreatetruecolor'>function.imagecreatetruecolor</a>]: Invalid image dimensions in /home/kuklik/domains/kuklik.linuxpl.info/public_html/Galeria/generators/preview.php on line 57, referer: http://www.kuklik.linuxpl.info/Galeria/vie....php?imageid=94
[Fri Jan 18 12:11:17 2013] [warn] [client 89.228.68.84] mod_fcgid: stderr: PHP Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /home/kuklik/domains/kuklik.linuxpl.info/public_html/Galeria/generators/preview.php on line 58, referer: http://www.kuklik.linuxpl.info/Galeria/vie....php?imageid=94
[Fri Jan 18 12:11:17 2013] [warn] [client 89.228.68.84] mod_fcgid: stderr: PHP Warning: Cannot modify header information - headers already sent by (output started at /home/kuklik/domains/kuklik.linuxpl.info/public_html/Galeria/generators/preview.php:24) in /home/kuklik/domains/kuklik.linuxpl.info/public_html/Galeria/generators/preview.php on line 61, referer: http://www.kuklik.linuxpl.info/Galeria/vie....php?imageid=94
[Fri Jan 18 12:11:17 2013] [warn] [client 89.228.68.84] mod_fcgid: stderr: PHP Warning: imagejpeg() expects parameter 1 to be resource, boolean given in /home/kuklik/domains/kuklik.linuxpl.info/public_html/Galeria/generators/preview.php on line 62, referer: http://www.kuklik.linuxpl.info/Galeria/vie....php?imageid=94
Tu wklejam kod w którym wyrzuca warny:
<?php require("../includes/global.php"); $img = $db->execute($sql); if ($img->rows < 1){ notfound(); } // support for non-GD users function default_thumb(){ redirect("original.php?imageid=" . $img->fields["imageid"]); } // check for GD support and fopen wrapters if ($gd === FALSE){ default_thumb(); } // work out thumbnail size if ($size_cng < 1){ default_thumb(); } // create a temperory file $filepath = str_replace("preview", "original", "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["PHP_SELF"]); // thumbnail size //$thumbsize = intval($config["thumbnailsize"]); $thumbsize = $size_cng; $thumbsize = ($thumbsize < 10) ? 100 : $thumbsize; // create variables if ($size[0] < $thumbsize && $size[1] < $thumbsize){ $thumbnail_width = $size[0]; $thumbnail_height = $size[1]; } elseif($size[0] > $size[1]){ $thumbnail_width = $thumbsize; $thumbnail_height = (int)($thumbsize * $size[1] / $size[0]); } else { $thumbnail_width = (int)($thumbsize * $size[0] / $size[1]); $thumbnail_height = $thumbsize; } // create functions $function_suffix = $gd_function_suffix[$img->fields["format"]]; $function_to_read = 'ImageCreateFrom' . $function_suffix; $function_to_write = 'Image' . $function_suffix; if (!(function_exists($function_to_read))){ default_thumb(); } if (!(function_exists($function_to_write))){ default_thumb(); } $source_handle = $function_to_read($tmpname); $destination_handle = ImageCreateTrueColor($thumbnail_width, $thumbnail_height); ImageCopyResampled($destination_handle, $source_handle, 0, 0, 0, 0, $thumbnail_width, $thumbnail_height, $size[0], $size[1]); // output content $function_to_write($destination_handle); // and delete the tmp line ?>
Nie mogę rozgryźć jak zoptymalizować ten kod zeby nie było tych warnów a co za tym idzie zwiech strony..
link do strony : http://www.kuklik.linuxpl.info/Galeria
Czy ktoś może pomóc?