$preset['presetname'] . ' (imagecache + lightbox link)', 'types' => array('local' => array('jpg','gif','png')), ); } } return $formats; case 'options': $path = imagecache_create_path($attr['format'], $asset->filepath); if(!file_exists($path)){ // this is the easiest albeit indirect way i can see to generate the image $result = drupal_http_request(url(file_create_url($path))); } $size = image_get_info(imagecache_create_path($attr['format'], $asset->filepath)); $form['width'] = array('#type' => 'hidden', '#value' => $size['width']); $form['height'] = array('#type' => 'hidden', '#value' => $size['height']); $form['resizable'] = array(); $form['_width'] = array( '#type' => 'item', '#title' => t('Width, preset by imagecache'), '#value' => $size['width'] . 'px', ); $form['_height'] = array( '#type' => 'item', '#title' => t('Height, preset by imagecache'), '#value' => $size['height'] . 'px', ); return $form; break; case 'img': return imagecache_create_path($attr['format'], $asset->filepath); case 'preview': return theme('imagecache', $attr['format'], $asset->filepath, '', '', array('width' => '100')); case 'render': return '' . theme('imagecache', $attr['format'], $asset->filepath) . ''; } }