problem in creating thumb picture in php
<p>I am using following function to create thumb picture in php</p>

<pre><code>function createThumbnail($img,$imgPath,$newPath,$newWidth,$newHeight,$quality)
{
    $path=$imgPath."/".$img;
    echo $path;
    $original = imagecreatefromjpeg($path);

    if($original)
    {
        echo "occur1";
        list($width, $height, $type, $attr) = getimagesize("$imgPath/$img");
        $tempImg = imagecreatetruecolor($newWidth, $newHeight) or die("Cant create temp image");
        imagecopyresized($tempImg, $original, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height)        or die("Cant resize copy");
        imagejpeg($tempImg, "$newPath/$img", $quality) or die("Cant save image");

        // Clean up.
        imagedestroy($original);
        imagedestroy($tempImg);
        return true;
    }
    else
    {
        echo "oc";
        return false;
    }
}
</code></pre>

<p>when calling this function it showing black screen.i am displaying echo statement before and after</p>

<pre><code>$original = imagecreatefromjpeg($path);
</code></pre>

<p>it shows only first echo statement second echo statement not displaying.What is the problem.</p>
