Strange, when I'm using a Safari browser, I can see a small question box at the start of a teaser story or even in a main body. But in Firefox, you can't see it but you can tell there's a invisible image because the way the text indented to the right.

I'd just used this in my style.css

#content img {
border: 0;
float: left;
margin-right: 5px;
margin-top: 5px;

CommentFileSizeAuthor
duh.jpg51.58 KBrosgar

Comments

leoklein’s picture

rosgar’s picture

Hmmm... so the drupal developers don't care with this kind of issue? Problem with the template I guess.

leoklein’s picture

It's a hack for imagecache but it works:

http://drupal.org/node/88136#comment-230649

My version of imagecache is 5.x-1.3 and the line to change is 744.

rosgar’s picture

So, are you saying editing the imagecache.module..

at line 744

if ($path) {
return 'Only local images are allowed.'; }

ok!

rosgar’s picture

oooppps!

should be...

 if ($path) {
  return '<img src="'. $imagecache_path .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $attributes .' />';
} 
rosgar’s picture

it didn't work. It interferes with line 753...

So, I change this again...

 if ($path) {
  return '<img src="'. $imagecache_path .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $attributes .' />';
}

to this

 if ($path) 
  return '<img src="'. $imagecache_path .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $attributes .' />';
}

deleting the {

gusaus’s picture

this little hack works! would be great if this fix could go into the actual module.

csc4’s picture

A fix in the module would be good but should the code actually be testing for $imagecache_path not $path - ie

 if ($imagecache_path)
  return '<img src="'. $imagecache_path .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $attributes .' />';
}
pingers’s picture

I think this attacks the problem too late... this can be detected much earlier in imagecache_field_formatter($field, $item, $formatter)

254  if (!isset($item['filepath'])) {
255    $file = _imagecache_file_load($item['fid']);
         if (!count($file)) {
           return '';
         }
256    $item = array_merge($item, $file);
257  }

This works for me and saves unnecessary function calls.

Crimson’s picture

The dev-1.x version seems to have fixed the problem in the teaser but not in the full node view.

Edit: The dev-2.x version of imagefield together with the new imagecache seems to fix everything.

rosgar’s picture

OK, gonna test this new version.. thanks!

rosgar’s picture

OK..i tested the combination of the two dev. version...
imagefield-5.x-1.x-dev
and
imagecache-5.x-1.x-dev

Deleted the 2 previous modules,

then use update.php. After that, all images disappeared. Yay!

What I did is to update preset on both thumbnail and main image of imagecache module.

Seems fine to me now.

dopry’s picture

Status: Active » Closed (fixed)

This should be fixed in 2.x.