When thumb.pages.inc > _thumb tries to create a new file, it does not take the folder drupal is installed to into account. It seems like the code assumes that Drupal is installed to a domain.

I added the following code to make this work:

$folder = url(NULL, array('absolute' => FALSE));
$dir = $root . $folder . ''. file_directory_path() .'/thumb/'. $presetname .'/'. $pathinfo['dirname'];

Comments

davyvdb’s picture

Status: Active » Postponed (maintainer needs more info)

Do you have the same issue with the imagecache module?

davyvdb’s picture

I'm using the following code to get the directory :

// Build the destination folder tree if it doesn't already exists.
  $root = realpath((getenv('DOCUMENT_ROOT') && ereg('^'. preg_quote(realpath(getenv('DOCUMENT_ROOT'))), realpath(__FILE__))) ? getenv('DOCUMENT_ROOT') : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', dirname(__FILE__))));
  
  $dir = $root .'/'. file_directory_path() .'/thumb/'. $presetname .'/'. $pathinfo['dirname'];
  if (!file_check_directory($dir, FILE_CREATE_DIRECTORY) && !mkdir($dir, 0775, TRUE)) {
    watchdog('imagecache', 'Failed to create imagecache directory: %dir', array('%dir' => $dir), WATCHDOG_ERROR);
    return FALSE;
  }

Can you debug this and see what goes wrong in your situation?

davyvdb’s picture

Status: Postponed (maintainer needs more info) » Fixed

fixed this with base_path

$dir = $root . base_path() . file_directory_path() .'/thumb/'. $presetname .'/'. $pathinfo['dirname'];

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.