I wonder if is it possible to keep the cached screenshot in a CCK field, maybe combining it with a module like Remote File. So it could be integrated in Views or make use of Imagecache presets too.

Thanks in advanced.

Comments

geobaev’s picture

Assigned: Unassigned » geobaev
Status: Active » Needs review

This is a good idea and it is in my plans for the further enhancement of the module.

Anonymous’s picture

I would definitely like to see this functionality, mainly in the 7.x branch, tho. :-)

1. local cache
2. image handled as "regular" imagefield

naeluh’s picture

I really would like this functionality too!

bennos’s picture

+1 for this feature in the D7 Version.

some great things can be done like saving the last thumbnail or a view with the last thumbnail to see what changes are made on the design or layout of a page.

puravida’s picture

This feature is currently being considered.

arsirc’s picture

Assigned: geobaev » arsirc
Category: support » feature
Status: Needs review » Needs work

If i understand your requests correctly you want the possibility to place the thumbnail inside a CCK field without the need of the Link module, correct?

Would it also be useful to support the Link module in the 6.x branch of the plugin?

bennos’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

the original feature reuqest was for D6 more then 1 1/2 year ago. think we should talk about D7 version.
saving the thumbnails in a D7 core imagefield would be nice, so we can do a lot of things like external caching, processing it via th image API and more.

puravida’s picture

@bennos
It sounds like of a lot of great inter-module functionality could happen there.

If you don't mind, please show off your integration once you get it working like you want. ;)
http://www.shrinktheweb.com/forums/stw-developer-community/show-your-pag...

I believe that we (e.g. arsirc) will be able to do this for D7.

bennos’s picture

will post my solution there.

taote’s picture

Is it not possible to add a new formatter for the Link module where the only output would be the url of the local cached image? So, this could be used and modify through PHP using Views.

This the easiest solution I can figure out.

Is it possible? Some ideas?

zarexogre’s picture

Issue summary: View changes

Hi, I wanted to cache the shrinktheweb files locally makes massive difference to load time. I hacked this function:

function theme_shrinktheweb_image($variables) {
  $url = $variables['url'];  
  $options = $variables['options'];
  
  if ($src = shrinktheweb_get_thumbnail($url)) {
    $options['path'] = $src;
    
    //download image here if not already downloaded
    $id = str_replace('http://','',$url);
    $id = str_replace('https://','',$id);
    $id = str_replace('/','',$id);
    $id = str_replace('.','_',$id);
    $local_path = getcwd().'/sites/default/files/shrinktheweb_thumbnails/'.$id.'.jpg';

    if(!file_exists($local_path)) {      
      $remote_image = file_get_contents($src);      
      //Store in the filesystem.      
      $fp = fopen($local_path, "w");
      fwrite($fp, $remote_image);
      fclose($fp);            
      die($url.' no thumb');
    } else {
      $path = str_replace(getcwd().'/sites/default/files/','public://',$local_path);      
      $thumb = theme('image_style',array(
          'style_name' => 'thumb_web_link',
          'path' => $path,
        )
      );
      return $thumb; 
    }

    $options['path'] = 'public://'.str_replace(getcwd().'/sites/default/files/','',$local_path);
    
    $options['attributes'] = (!empty($options['attributes'])) ? $options['attributes'] : array();
    return theme_image($options);
  }
  return FALSE;
}

Its not sexy but it works, maybe we could improve this so it works well and the code is cleaner?

devdokimov’s picture

Assigned: arsirc » devdokimov
puravida’s picture

Drupal8 provides an automatic caching framework, and we are working on a new release for D8.x that will utilize this functionality by default. This will streamline our integration, eliminate potential caching issues, and speed up website screenshot image loading automatically.

For the older 7.x version, we are going to consider supporting this CCK option but have some pressing tasks to handle first. I will update this thread when we are ready to take another look or in the case that someone else comments.