diff -urp ../galleria.original/galleria.admin.inc ./galleria.admin.inc --- ../galleria.original/galleria.admin.inc 2009-02-26 16:50:28.000000000 -0500 +++ ./galleria.admin.inc 2009-02-26 16:50:26.000000000 -0500 @@ -21,6 +21,32 @@ function galleria_admin_settings() { '#default_value' => variable_get('galleria_thumb_opacity', 0.3), '#description' => t('Value from 0 .. 1'), ); + + // Code based on from Taxonomy Image's ImageCache support + // If ImageCache module is found, add its presets as available options + // for how to display the image. + if (module_exists('imagecache')) { + $raw_presets = imagecache_presets(); + $presets[''] = t('None'); + foreach ($raw_presets as $preset_id => $preset_info) { + $preset = $preset_info['presetname']; + $presets[$preset] = $preset; + } + $form['galleria_imagecache_preset'] = array( + '#type' => 'select', + '#title' => t('ImageCache preset'), + '#options' => $presets, + '#default_value' => variable_get('galleria_imagecache_preset', 'None'), + ); + } + else { + $form['galleria_imagecache_preset'] = array( + '#type' => 'item', + '#title' => t('ImageCache not installed'), + '#description' => t('Install ImageCache to allow resizing for Galleria images.'), + '#value' => variable_get('galleria_imagecache_preset', 'None'), + ); + } return system_settings_form($form); } diff -urp ../galleria.original/galleria.install ./galleria.install --- ../galleria.original/galleria.install 2009-02-26 16:50:28.000000000 -0500 +++ ./galleria.install 2009-02-26 16:50:27.000000000 -0500 @@ -6,6 +6,7 @@ */ function galleria_uninstall() { variable_del('galleria_thumb_opacity'); + variable_del('galleria_imagecache_preset'); $node_types = node_get_types('names'); foreach ($node_types as $type) { diff -urp ../galleria.original/galleria.module ./galleria.module --- ../galleria.original/galleria.module 2009-02-26 16:50:28.000000000 -0500 +++ ./galleria.module 2009-02-26 16:50:27.000000000 -0500 @@ -229,10 +229,19 @@ function template_preprocess_galleria(&$ foreach ($files as $file) { $caption = $file->description != $file->filename ? $file->description : ''; - $images[] = array( - 'data' => theme('image', $file->filepath, $caption, $caption), - 'class' => $i == 0 ? 'active' : '', - ); + if (module_exists('imagecache') && variable_get('galleria_imagecache_preset', 'None')){ + $images[] = array( + 'data' => theme('imagecache', variable_get('galleria_imagecache_preset', 'None'), $file->filepath, $caption, $caption), + 'class' => $i == 0 ? 'active' : '', + ); + } + else { + $images[] = array( + 'data' => theme('image', $file->filepath, $caption, $caption), + 'class' => $i == 0 ? 'active' : '', + ); + } + $i++; }