function _imagecache_percent_filter in ImageCache 5
Same name and namespace in other branches
- 5.2 imagecache.module \_imagecache_percent_filter()
- 6.2 imagecache.module \_imagecache_percent_filter()
Accept a percentage and return it in pixels.
1 call to _imagecache_percent_filter()
- _imagecache_filter in ./
imagecache.module - Filter key word values such as 'top', 'right', 'center', and also percentages. All returned values are in pixels relative to the passed in height and width.
File
- ./
imagecache.module, line 344 - Dynamic image resizer and image cacher.
Code
function _imagecache_percent_filter($value, $current_pixels) {
if (strpos($value, '%') !== FALSE) {
$value = str_replace('%', '', $value) * 0.01 * $current_pixels;
}
return $value;
}