title: saving cropped images in unique name?
body: <p>This script helps me crop and save images. every time i save an image it saves has crop.jpg .. can i save it in a different name? i have an input field with image name.. "$_POST['imgname']" how can i use this has image name for the cropped image?</p>
  
  <pre><code>&lt;?php
  $canvasImg = $_POST['img'];    
  $data = base64_decode($canvasImg);
  $File = "captured.jpg"; 
  $Handle = fopen($File, 'w');
  fwrite($Handle, $data);  
  fclose($Handle);
  
  $src_image = imagecreatefrompng($File);
  $width = imagesx($src_image);
  $height = imagesy($src_image);
  
  $dst_x = 0;
  $dst_y = 0;
  $src_x = $width*0.350; // Crop Start X
  $src_y = $height*0.165; // Crop Srart Y
  $dst_w = $width*0.294; // Thumb width
  $dst_h = $height*0.470; // Thumb height
  $src_w = $dst_w; // $src_x + $dst_w
  $src_h = $dst_h; // $src_y + $dst_h
  
  $image = imagecreatetruecolor($dst_w, $dst_h);
  imagealphablending($image, false);
  $col=imagecolorallocatealpha($image,255,255,255,127);
  imagefilledrectangle($image,0,0,$dst_w, $dst_h,$col);
  imagealphablending($image,true);
  
  imagecopyresampled($image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
  imagealphablending($image,true);
  imagealphablending($image,false);
  imagesavealpha($image,true);
  imagepng($image, "images/crop.jpeg");
  imagedestroy($image);
  ?&gt;
  </code></pre>