Returns the URI of an image when using a style.
The path returned by this function may not exist. The default generation method only creates images when they are requested by a user's browser.
$style_name: The name of the style to be used with this image.
$uri: The URI or path to the image.
The URI to an image style image.
function image_style_path($style_name, $uri) {
$scheme = file_uri_scheme($uri);
if ($scheme) {
$path = file_uri_target($uri);
}
else {
$path = $uri;
$scheme = file_default_scheme();
}
return $scheme . '://styles/' . $style_name . '/' . $scheme . '/' . $path;
}