title: getting jpeg error
body: <pre><code>&lt;?php
  
  function LoadPNG()
  {
      /* Attempt to open */
      //require_once 'resizex.php';
      $imgname="/home2/puneetbh/public_html/prideofhome/wp-content/uploads/268995481image_11.png";
      //$im = @imagecreatefrompng($imgname);
      $img= imagecreatefromstring(file_get_contents($imgname));
      //$im=imagecreatefrompng('images/frame.png');
      $im= imagecreatefromjpeg('images/frame.jpeg');
      //imagealphablending($img, false);
      //imagesavealpha($img, true);
  
      //$img=resizex("$url",60,65,1);
      imagecopymerge($im,$img,105,93,0, 0,275,258,100);
      /* See if it failed */
      if(!$im)
      {
          /* Create a blank image */
          $im  = imagecreatetruecolor(150, 30);
          $bgc = imagecolorallocate($im, 255, 255, 255);
          $tc  = imagecolorallocate($im, 0, 0, 0);
  
          imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
  
          /* Output an error message */
          imagestring($im, 1, 5, 5, 'Error loading ' . $imgname, $tc);
      }
  
      return $im;
  }
  $img = LoadPNG();
  header('Content-type: image/jpeg');
  imagejpeg($im);
  imagedestroy($im);
  imagedestroy($img);
  
  ?&gt;
  </code></pre>
  
  <p>i am getting error 
  arning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /home2/puneetbh/public_html/prideapp/frame.php on line 11</p>
  
  <p>Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'images/frame.jpeg' is not a valid JPEG file in /home2/puneetbh/public_html/prideapp/frame.php on line 11</p>
  
  <p>Warning: imagecopymerge(): supplied argument is not a valid Image resource in /home2/puneetbh/public_html/prideapp/frame.php on line 16</p>
  
  <p>Warning: Cannot modify header information - headers already sent by (output started at /home2/puneetbh/public_html/prideapp/frame.php:11) in /home2/puneetbh/public_html/prideapp/frame.php on line 34</p>
  
  <p>Warning: imagejpeg(): supplied argument is not a valid Image resource in /home2/puneetbh/public_html/prideapp/frame.php on line 35</p>
  
  <p>Warning: imagedestroy(): supplied argument is not a valid Image resource in /home2/puneetbh/public_html/prideapp/frame.php on line 36</p>