Post by Sidecutter » Wed May 04, 2011 10:13 pm

Using 1.4.9.4, trying to do a final test install to make sure I have everything nailed down before I do a final store install. I'm getting "Fatal error: Class 'Image' not found in /home/captured/www/www/test0/catalog/model/tool/image.php on line 27". However, I can't see any reason for a problem and the image.php file mentioned is stock with no mods. I've even swapped in the catalog/model/tool/image.php and system/library/image.php files from my prior working test setup that I've been using to get everything going, and I get the same error, just with a different line number ...help?

*EDIT* I'm getting the same error (Fatal error: Class 'Image' not found in /home/captured/www/www/test0/admin/model/tool/image.php on line 27) when trying to access Products in the admin console.

Code: Select all

<?php
class ModelToolImage extends Model {
	function resize($filename, $width, $height) {
		if (!file_exists(DIR_IMAGE . $filename) || !is_file(DIR_IMAGE . $filename)) {
			return;
		} 
		
		$info = pathinfo($filename);
		$extension = $info['extension'];
		
		$old_image = $filename;
		$new_image = 'cache/' . substr($filename, 0, strrpos($filename, '.')) . '-' . $width . 'x' . $height . '.' . $extension;
		
		if (!file_exists(DIR_IMAGE . $new_image) || (filemtime(DIR_IMAGE . $old_image) > filemtime(DIR_IMAGE . $new_image))) {
			$path = '';
			
			$directories = explode('/', dirname(str_replace('../', '', $new_image)));
			
			foreach ($directories as $directory) {
				$path = $path . '/' . $directory;
				
				if (!file_exists(DIR_IMAGE . $path)) {
					@mkdir(DIR_IMAGE . $path, 0777);
				}		
			}
			
			$image = new Image(DIR_IMAGE . $old_image);
			$image->resize($width, $height);
			$image->save(DIR_IMAGE . $new_image);
		}
		
		if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
			return HTTPS_IMAGE . $new_image;
		} else {
			return HTTP_IMAGE . $new_image;
		}	
	}
}
?>

Active Member

Posts

Joined
Tue Jan 18, 2011 6:58 am

Post by dan74mm » Fri May 17, 2013 10:11 pm

I am using OC 1.5.1.2 and have the same problem !!! Please helpe me ...

Code: Select all

Fatal error: Class 'Image' not found in /home/myfolder/public_html/catalog/model/tool/image.php on line 27

New member

Posts

Joined
Sat Oct 22, 2011 11:08 am
Who is online

Users browsing this forum: No registered users and 12 guests