function image_resize
7.x image.inc | image_resize(stdClass |
6.x image.inc | image_resize($source, $destination, $width, $height) |
Resizes an image to the given dimensions (ignoring aspect ratio).
Parameters
$image: An image object returned by image_load().
$width: The target width, in pixels.
$height: The target height, in pixels.
Return value
TRUE on success, FALSE on failure.
See also
Related topics
4 calls to image_resize()
- ImageToolkitUnitTest::testResize in drupal-7.x/
modules/ simpletest/ tests/ image.test - Test the image_resize() function.
- image_resize_effect in drupal-7.x/
modules/ image/ image.effects.inc - Image effect callback; Resize an image resource.
- image_scale in drupal-7.x/
includes/ image.inc - Scales an image while maintaining aspect ratio.
- image_scale_and_crop in drupal-7.x/
includes/ image.inc - Scales an image to the exact width and height given.
3 string references to 'image_resize'
- ImageAdminStylesUnitTest::testStyle in drupal-7.x/
modules/ image/ image.test - General test to add a style, add/remove/edit effects to it, then delete it.
- ImageStyleFlushTest::testFlush in drupal-7.x/
modules/ image/ image.test - General test to flush a style.
- image_image_effect_info in drupal-7.x/
modules/ image/ image.effects.inc - Implements hook_image_effect_info().
File
- drupal-7.x/
includes/ image.inc, line 279 - API for manipulating images.
Code
function image_resize(stdClass $image, $width, $height) {
$width = (int) round($width);
$height = (int) round($height);
return image_toolkit_invoke('resize', $image, array($width, $height));
}