Drupal 7 image styles ignored by theme preprocess function I want to display images at the proper image style-defined size, but there's a problem being caused by a preprocess function written by the person who built this site before I came onto the project. 

function abc_field__field_video_thumbnail($variables) {
    $output = '';

    // Render the items
    foreach ($variables['items'] as $item) {
        $output .= "&lt;div class=\"field-item\"&gt;\r";
        $output .= '&lt;a href="' . $movieurl . '" target="popup" data-popup-width="' . $variables['element']['#object']-&gt;field_video_width['und'][0]['value'] . '" data-popup-height="' . $variables['element']['#object']-&gt;field_video_height['und'][0]['value'] . '"&gt;';
        $output .= '&lt;img src="' . file_create_url($item['#item']['uri']) . '" alt="" width="' . $item['#item']['width'] . '" height="' . $item['#item']['height'] . '" class="' . $item['#image_style'] . '"&gt;' . "\r";
        $output .= '&lt;img src="/' . drupal_get_path('theme', 'nwe').'/images/button_play.png' . '" alt="Play Video" width="110" height="110" class="play-icon"&gt;' . "\r";
        $output .= "&lt;/a&gt;\r\r";
        $output .= "&lt;/div&gt;\r\r";
}

    // Render the top-level div
    $output = '&lt;div class="' . $variables['classes'] . '"' . $variables['attributes'] . '&gt;' . $output . '&lt;/div&gt;';

    return $output;
}


This seems to assume the image style processing would occur before this function happened, but unfortunately it doesn't, and I get a full-size image regardless of image style.
By taking over the display of that field you're actually bypassing all the field system would usually do to apply the custom display settings; it basically passes off the responsibility of creating the field HTML to you, and provides you with the raw values you'll need to build it up. 

So if you want to output a style based image, you'll need to do it manually using theme_image_style():

$args = array('style_name' =&gt; 'thumbnail', 'path' =&gt; $item['#item']['uri'], 'alt' =&gt; 'Alt text');
$image = theme('image_style', $args);

// Append $image to your output...