title: Call to a member function resize() on a non-object in
body: <p>I use a script to upload images.</p>
  
  <p>in the script i want to create thumbnails.</p>
  
  <p>First i make a copy, after the copy i want to resize the copy.</p>
  
  <p>I have</p>
  
  <pre><code>$originalfile =//the file i just uploaded
  
  $kopiefile = //the copy destination /same filename as original but with an extra dir added.
  
  if (!copy($originalfile, $kopiefile)) {
      echo "failed to copy $originalfile...\n";
  } else {
      $kopiefile = "http://mydomain.com/media/img/thumbs/".$file_name;
      echo $kopiefile;
      $kopiefile -&gt; resize(300, 0, false);
  }
  </code></pre>
  
  <p>the copy file works i can see the newly created file.</p>
  
  <p>The echo $kopiefile gives me a link directly to the image wich works if i copy the link.</p>
  
  <p>but now i get to the </p>
  
  <pre><code>$kopiefile -&gt; resize(300, 0, false);
  </code></pre>
  
  <p>part and i get the error</p>
  
  <p>Fatal error: Call to a member function resize() on a non-object in .... line 176</p>
  
  <p>where line 176 is </p>
  
  <pre><code>$kopiefile -&gt; resize(300, 0, false);
  </code></pre>
  
  <p>what is wrong with my code?</p>
  
  <p>i also tryd to use:</p>
  
  <p>$kopiefile = "/home/censored/domains/censored/public_html/ve/media/img/thumbs/".$file_name;</p>
  
  <p>but it isnt working.</p>
  
  <p>Can someone plz help me.</p>