Internal Server Error with WordPress and PHP
-
I have a very simple PHP code which does a circular crop for the gravatar.
In the loop, the code is being executed like so:
<img src="<?php echo crop_avatar(get_avatar(get_the_author_ID(), 200)); ?>" width="85" height="85"> <?php // Sends the gravatar path to image.php function crop_avatar($path) { preg_match("/src='(.*?)'/i", $path, $matches); return get_template_directory_uri() . "/image.php?path=". $matches[1]; } ?>
and in PHP the code would be something like this
if(isset($_GET['path'])) { $path = $_GET["path"]; $image = imagecreatefromjpeg($path); $width = imagesx($image); $height = imagesy($image); // CircleCrop class is just a simple PHP GD image manipulation $crop = new CircleCrop($image,$width,$height); // Convert the header to PNG $crop->crop()->display(); }
anybody has any ideas? please..
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Internal Server Error with WordPress and PHP’ is closed to new replies.