heyya,

im tryna resize a remote image with no luck, heres my code,

PHP Code: 
        $pixels getimagesize($url); // Get image size in pixels for remote.
        
$width2 $pixels[0];
        
$height2 $pixels[1];

        
//Make a 90x90px thumbnail......
        
$fileURL = ($uploadDir '/' $newname);
        
//echo $fileURL;
        
        
if ($exten == "image/pjpeg" || $exten == "image/jpeg") { $newThumbImg imagecreatefromjpeg($fileURL); }
        
        if (
$exten == "image/x-png" || $exten == "image/png") { $newThumbImg imagecreatefrompng($fileURL); }
        
        if (
$exten == "image/gif") { $newThumbImg imagecreatefromgif($fileURL); }
        
        
$ratio $width2 $height2// calculate the ratio

        
if ($ratio ) {
        
            
$newW $thumbPixels;
            
$newH $thumbPixels $ratio;
    } else {
            
            
$newH $thumbPixels;
            
$newW $thumbPixels $ratio;
    }
    
    
//function for resize image.

    
if ( function_exists 'imagecreatetruecolor' ) ) {

            
$newImg imagecreatetruecolor($newW$newH);
    } else {

            die(
"Error: Please make sure you have GD library ver 2+");
    }

    
//the resizing is going on here!

    
imagecopyresized($newImg$newThumbImg0000$newW$newH$width2$height2);
    
    
$imageFileClean preg_replace("/Resource id #6/"""$newname);
    
//finally, save the image
    
    
ImageJpeg ($newImg$thumbDir $newname);
     
    
ImageDestroy ($newImg);
    
ImageDestroy ($newThumbImg); 
and im getting these errors:

Code: 
Notice:  Undefined variable: newThumbImg in C:\wamp\www\includes\imageupload.php on line 288

Warning:  imagecopyresized() expects parameter 2 to be resource, null given in C:\wamp\www\includes\imageupload.php on line 288

Notice:  Undefined variable: newThumbImg in C:\wamp\www\includes\imageupload.php on line 296

Warning:  imagedestroy() expects parameter 1 to be resource, null given in C:\wamp\www\includes\imageupload.php on line 296


The same ^^ code is working for local images... so any1 can help?
Chris2k Reviewed by Chris2k on . remote imge resize heyya, im tryna resize a remote image with no luck, heres my code, $pixels = getimagesize($url); // Get image size in pixels for remote. $width2 = $pixels; $height2 = $pixels; //Make a 90x90px thumbnail...... Rating: 5