if you change the theme_imagecache function from this:

function theme_imagecache($namespace, $path, $alt = '', $title = '', $attributes = NULL ) {

  $attributes = drupal_attributes($attributes);
  $imagecache_path = file_create_url(file_directory_path() .'/imagecache/'. $namespace .'/'. $path);
  return '<img src="'. $imagecache_path .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $attributes .' />';
}

to this:

function theme_imagecache($namespace, $path, $alt = '', $title = '', $attributes = NULL ) {

  $attributes = drupal_attributes($attributes);
  if(!file_exists(file_create_path('imagecache/'.$namespace.'/'.$path)) && variable_get('clean_url', 0) == 0) {
        $imagecache_path = 'http://'.$_SERVER['HTTP_HOST'].base_path().'?q='.file_directory_path() .'/imagecache/'. $namespace .'/'. $path;
  } else {
        $imagecache_path = file_create_url(file_directory_path() .'/imagecache/'. $namespace .'/'. $path);
  }
  return '<img src="'. $imagecache_path .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $attributes .' />';
}

you will have the imagecache working also without the clean URL.. nice no? :)

Comments

jpetso’s picture

Status: Reviewed & tested by the community » Needs review

Nice little hack, but please don't set your own patches to "ready to be committed" except for the most straightforward, bug fixing one-liners. That's the task of reviewers that are trusted by the module maintainers.

ademarco’s picture

Title: imagecache working also without clean URL support... solved! :) » sorry...

...you're right, I'll follow your advise next time... bye! :)

jpetso’s picture

Title: sorry... » imagecache working also without clean URL support... solved! :)
Priority: Critical » Normal

Resetting the issue title. I don't know whether it should be left open or not, though.

dopry’s picture

Status: Needs review » Needs work

Frankly I'm strongly of the opinion you shouldn't be using imagecache without clean url support... It kind of violates the idea of using it for public files... while It has the same performance impact as private files + imagecache...

However if you want me to consider this submit it as a proper patch...

http://drupal.org/patch/create

dopry’s picture

Status: Needs work » Closed (fixed)