Warning: imagejpeg() [function.imagejpeg]: unable to open '../photos/uploads/40y.jpg'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pradeep28march
    New Member
    • Jun 2010
    • 2

    #1

    Warning: imagejpeg() [function.imagejpeg]: unable to open '../photos/uploads/40y.jpg'

    Code:
    function createSaveJPGThumb($filename, $uploadfile, $newwidth, $quality = 80){
    
    			//resize image to max 800 wide
    
    			list($width, $height) = getimagesize($filename);
    
    			$newheight = $height * ($newwidth/$width);
    
    			$thumb = imagecreatetruecolor($newwidth, $newheight);
    
    			$source = imagecreatefromjpeg($filename);
    
    			imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
    
    			$saved = imagejpeg($thumb,$uploadfile,$quality);
    
    			return $saved;
    
    	}
    Last edited by Dormilich; Jun 30 '10, 06:09 PM. Reason: Please use [code] tags when posting code
  • JKing
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    Is your filename/path correct?

    Comment

    • pradeep28march
      New Member
      • Jun 2010
      • 2

      #3
      but its not working proper error show unable to upload images in upload folder !!!

      Comment

      Working...