I've added imagecache_external functionality to the 7.x-1.x-dev version of this module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

13rac1’s picture

Status: Needs review » Needs work

Thanks for your work! I hope to have time next week to work on this module. Can you supply a git patch? This is more difficult to work with.

Summit’s picture

Hi, Does this extention need: http://drupal.org/node/975222/release ? Imagecache_external itself?

Edit: I see that the img_style is hardcoded. I do not think that is correct:

function link_image_field_formatter_info() {
  return array(
    'link_image' => array(
      'label' => t('Image with URL as source, title as alt tags.'),
      'field types' => array('link_field'),
	  'settings'  => array( //Default settings
        'img_style' => 'thumbnail',  <======
      ),
    ),
  );
}

I am not able to change the image style from thumbnail to another. Thanks for your help in advance.
Edit2: I am able to change the image style. It is working ok. It was a panels setting on my behave.

Greetings, Martijn

martysteer’s picture

Hey, sorry. been away.
Unfortunately I'm using windows and have had a sh*t figuring out tortoisegit. Could you possibly work with it?

Also, something strange (which I have yet to find time to track down but I think is an imagecache_external thing, i.e. not for this thread), is each time my page loads using the formatter it's generating new local thumbs of the external images. There's something seeding the hash for external imagecache urls such that they are different each page refresh.

Summit’s picture

Hi,
Yes it is working great now, thanks for building this!
The other thing you put on, I do not see, but will check it.
Greetings, Martijn

Summit’s picture

Hi,
I have somehow a problem with image urls like underneath . Image Url's with arguments
Somehow these url's are not correctly transfered to imagecache_external.

http://wintersport.sunweb.nl/utilpages/getimage.ashx?width=264&height=176&file=Images/Web1/100000/32000/132999-Web1.jpg

Somehow the variable after the first ? is forgotten.
The error report says for imagecache_external:

The image http://wintersport.sunweb.nl/utilpages/getimage.ashx could not be retrieved

I think this is maybe because of unmissing arguments through

$image = array(
    'path' =>  $item['url'],
	'style_name'=> $item['style_name'],
  );

I am not a programmer, so sorry if I am completely mistaken!
Greetings,
Martijn

Summit’s picture

Hi, anyone knows what is wrong here please?
Thanks a lot in advance for your reply!
Greetings, Martijn

pefferen’s picture

Hi Summit,

I run across your problem, you are right the query part of the url is missing ie the part after the '?' . I changed the code to be like this:

function theme_link_image_formatter($vars) {
  $item = $vars['element'];

  // add the query part back to the url, provided there is any
  if(isset($item['query'])) {
    $query = "?";
    foreach ($item['query'] as $key => $value) {
      $query = $query . $key . "=" . $value . "&"; 
    }
    $fullurl = $item['url'] . $query;
    } else {
      $fullurl = $item['url'];
  }

  $image = array(
    'path' => $fullurl,
	'style_name'=> $item['style_name'],
  );

This works for me, with the example you provided. Hope it helps.

Summit’s picture

Hi,
Will this be committed please?
Greetings, Martijn

13rac1’s picture

@Summit, if a patch is supplied I'll commit it.

interdruper’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
6.02 KB

Here is a summary patch that fix several issues and add a new feature.

Fixes

New features

  • New option for showing the link title as a caption, below the rendered image (this code is mine ;)
  • Imagecache External module is not a dependency