function image_style_path
image_style_path($style_name, $uri)
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.
Parameters
$style_name: The name of the style to be used with this image.
$uri: The URI or path to the image.
Return value
The URI to an image style image.
See also
File
- modules/image/image.module, line 1096
- Exposes global functionality for creating image styles.
Code
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; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!image!image.module/function/image_style_path/7.x