$variables['width'], 'height' => $variables['height'], ); image_style_transform_dimensions($variables['style_name'], $dimensions); $variables['width'] = $dimensions['width']; $variables['height'] = $dimensions['height']; } else { unset($variables['width'], $variables['height']); } // Determine the url for the styled image. $variables['path'] = image_style_url($variables['style_name'], $variables['path']); return theme('image', $variables); } function sigma_preprocess_search_result(&$variables) { // Add to result for displaying images for products. $n = node_load($variables['result']['node']->nid); $build = node_view($n, 'search_result'); if (isset($build['product:field_image'][0]['#item']['uri']) && (!empty($build['product:field_image'][0]['#item']['uri']))){ $n->product_image = $build['product:field_image'][0]['#item']['uri']; $variables['result']['product_image']= theme_image_style(array( 'path' => $n->product_image, 'style_name' => 'product-thumbnail', 'width'=>'100', 'height'=> '100')); } }