function vkxp_get_image_style_uri in VK CrossPoster 7.2
Provides image style uri.
If image does not exists it will create stylized image and return it uri.
Parameters
$file: Image file object.
$style: Requested image style machine name.
1 call to vkxp_get_image_style_uri()
- _vkxp_get_node_images in ./
vkxp.module - Get images from node.
File
- ./
vkxp.module, line 389
Code
function vkxp_get_image_style_uri($style, $file) {
$file_uri = image_style_path($style, $file->uri);
if (!file_exists($file_uri)) {
if (!image_style_create_derivative($style, $file->uri, $file_uri)) {
drupal_set_message(t('Failed to create stylized image'), 'error');
}
}
return $file_uri;
}