Hi,
I have a WordPress installation that has been modified slightly. It allows people to upload a picture of themselves using the following code:
public function update_image($ID, $image){
$uploaddir = wp_upload_dir();
$persondir = $uploaddir['basedir'].'/person/';
$persondirurl = $uploaddir['baseurl'].'/person/';
if(!file_exists($persondir)){
mkdir($persondir);
chmod($persondir, 0777);
}
$info = getimagesize($image);
switch($info[2]):
case 1 : $img =imagecreatefromgif($image); break;
case 2 : $img =imagecreatefromjpeg($image); break;
case 3 : $img =imagecreatefrompng($image); break;
endswitch;
$w = 89;
$h = 119;
$res_img = picture_resizeto($img,$w,$h);
$res_img_thimbnail = picture_resizeto($img,64,86);
imagepng($res_img, ($persondir.'/'.$ID.'.png'));
imagepng($res_img_thimbnail, ($persondir.'/'.$ID.'_small.png'));
chmod(($persondir.'/'.$ID.'.png'), 0777);
chmod(($persondir.'/'.$ID.'_small.png'), 0777);
imagedestroy($res_img);
imagedestroy($res_img_thimbnail);
imagedestroy($img);
update_post_meta($ID, '_image_small', $persondirurl.$ID.'_small.png');
return update_post_meta($ID, '_image', $persondirurl.$ID.'.png');
}
I would like to allow visitors to select just their face when they upload a picture and then it fits better in the thumbnail (89x119 pixels).
I installed "scissors" plugin thinking this would give me the functionaility but it only works when uploading photos to the blog.
Is there any way of acheiving the "crop" functionality of scissors when someone uploads a picture of themselves?
I hope you can decipher what I'm after from reading this post. If you need anymore information then please ask. I'd be very grateful if someone can help me with this.
Many thanks
John ;-)