Something occurred when moving your uploaded photo. Sorry. Please try again.'; } } else { $condition_photo = 'error'; $error_message .= '

Your photo was not a supported image file. Please ensure that your image file is either a JPEG, a GIF, or a PNG.

'; } } else { $condition_photo = 'error'; $error_message .= '

An error occurred. Sorry. Please try again.

'; } } else { $condition_photo = 'error'; $error_message .= '

You must upload a photo.

'; } if (($condition_photo == 'no-error') && ($_FILES['upload-plaid'])) // Were there no errors with the photo and is there a plaid image? { if ($_FILES['upload-plaid']['name']) // Does the plaid image have a filename? { $filename = stripslashes($_FILES['upload-plaid']['name']); //get the original name of the file from the clients machine $extension = strtolower(getExtension($filename)); //get the extension of the file and make it lowercase if (($extension == "jpg") || ($extension == "jpeg") || ($extension == "png") || ($extension == "gif")) // Is the file a photo? { $current_plaid = 'images/plaids/plaid' . $current_time . '.' . $extension; if (move_uploaded_file($_FILES['upload-plaid']['tmp_name'], $current_plaid)) // Did the file move successfully? { if ($_POST['tile']) // Did the user specify that we need to tile? { $old_plaid = $current_plaid; $current_plaid = 'images/plaids/tiledplaid' . $current_time . '.' . $extension; $imagemagick_command = $path_to_imagemagick . 'composite -tile ' . $old_plaid . ' -size 500x500 xc:none ' . $current_plaid; exec($imagemagick_command); } else // If not tile, resize { $imagemagick_command = $path_to_imagemagick . 'mogrify -size 1000x1000 -strip -resize 500x500^ ' . $current_plaid; exec($imagemagick_command); } } else { $condition_plaid = 'error'; $error_message .= '

Something occurred when moving your uploaded plaid file. Sorry. Please try again.

'; } } else { $condition_plaid = 'error'; $error_message .= '

Your plaid was not a supported image file. Please ensure that your image file is either a JPEG, a GIF, or a PNG.

'; } } } if (($condition_photo == 'no-error') && ($condition_plaid == 'no-error')) // So we've encountered no errors, right? { $avatar_file = 'images/avatars/avatar' . $current_time . '.png'; $imagemagick_command = "convert -size 500x500 xc:white \ $current_plaid -composite \ $current_photo -geometry +37+41 -composite \ images/shadow.png -geometry +37+41 -composite \ images/plaidteam.png -geometry +0+0 -composite \ $avatar_file"; exec($imagemagick_command); } } ?> @plaidteam Avatar Doohickey
avatar