Hey all. First time poster here. This looks like a great community!

I'm getting a "Parse error: syntax error, unexpected T_STRING" error. I'm just starting to get into PHP and can't for the life of me see where the problem is. This is part of the NextGen Gallery plugin for WordPress. The error is ocurring on line 183, which is the line: $this->oldImage = ini ImageCreateFromJpeg($this->fileName); I don't see any quotes out of place, or missing semi colons. Any ideas??

If you have the latest version of the nextgen gallery plugin it's the file located: lib/gd.thumbnail.inc.php

Code snippet context is here (problem code is near middle - {edit: line 17 in post}):

// increase memory-limit if possible, GD needs this for large images
		@ini_set('memory_limit', '256M');
        
		if($this->error == false) { 
        // Check memory consumption if file exists
			$this->checkMemoryForImage($this->fileName);
		}

        //initialize resources if no errors
        if($this->error == false) { 

            switch($this->format) {            	
                case 'GIF':
                    $this->oldImage = ImageCreateFromGif($this->fileName);
                    break;
                case 'JPG':
                       $this->oldImage = ini ImageCreateFromJpeg($this->fileName);
                    break;
                case 'PNG':
                    $this->oldImage = ImageCreateFromPng($this->fileName);
					break;
            }
			if (!$this->oldImage) { 
				$this->errmsg = 'Create Image failed. Check memory limit';
		        $this->error = true;
		    } else {
	            $size = GetImageSize($this->fileName);
    	        $this->currentDimensions = array('width'=>$size[0],'height'=>$size[1]);
	            $this->newImage = $this->oldImage;
	            $this->gatherImageMeta();
	        }
        }

Thanks for any help in advance!

Recommended Answers

All 2 Replies

remove the "ini " before ImageCreateFromJpeg on line 17

Great, thanks, that seems to have gotten rid of the T_STRING error...now I'm just getting errors that say "resize failed: Check memory limit" guess I'll see if I can edit the php.ini file on this server or not...thought that's what @ini_set('memory_limit', '256M'); was for. Thanks again for the quick response!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.