'checkbox', '#default_value' => (isset($data['upscale'])) ? $data['upscale'] : 0, '#title' => t('Allow Upscaling'), '#description' => t('Let scale make images larger than their original size'), ); return $form; } function theme_imagecache_scale($element) { $output = theme_imagecache_resize($element) . ', upscale: '; $output .= ($element['#value']['upscale']) ? t('Yes') : t('No'); return $output; } function imagecache_scale_image(&$image, $data) { // Set impossibly large values if the width and height aren't set. $data['width'] = $data['width'] ? $data['width'] : 9999999; $data['height'] = $data['height'] ? $data['height'] : 9999999; if (!imageapi_image_scale($image, $data['width'], $data['height'], $data['upscale'])) { watchdog('imagecache', 'imagecache_scale_image failed. image: %image, data: %data.', array('%image' => $image->source, '%data' => print_r($data, true)), WATCHDOG_ERROR); return false; } return true; } /** * ImageCache Scale and Crop */ function imagecache_scale_and_crop_form($data) { return imagecache_resize_form($data); } function theme_imagecache_scale_and_crop($element) { return theme_imagecache_resize($element); } function imagecache_scale_and_crop_image(&$image, $data) { if (!imageapi_image_scale_and_crop($image, $data['width'], $data['height'])) { watchdog('imagecache', 'imagecache_scale_and_crop failed. image: %image, data: %data.', array('%image' => $image->source, '%data' => print_r($data, true)), WATCHDOG_ERROR); return false; } return true; } /** * ImageCache Deprecated Scale. * This will be removed in imagecache 2.1 */ function imagecache_deprecated_scale_form($data) { $helptext = array(); $helptext['inside'] = t('Inside dimensions: Final dimensions will be less than or equal to the entered width and height. Useful for ensuring a maximum height and/or width.'); $helptext['outside'] = t('Outside dimensions: Final dimensions will be greater than or equal to the entered width and height. Ideal for cropping the result to a square.'); $description = '