Here you will find the IM constants: plugins/imanager/lib/inc/_def.php
By the way, you can also use following function to modify the images. It returns an image url sized/cropped to the specified dimensions:
Note that you must pass a SimpleItem as the first parameter.
By the way, you can also use following function to modify the images. It returns an image url sized/cropped to the specified dimensions:
PHP Code:
/**
* Returns URL to resized image
* The first time it is called, a thumbnail image is created and stored temporarily.
*
* @param object $image - An SimpleItem object
* @param integer $id - An index of the image field
* @param integer $width - Thumb width
* @param integer $height - Thumb height
*
* @return string - The image url indexed by $id
*
*/
function getResizedUrl(\SimpleItem $item, $id = 0, $width = 200, $height = 0, $type = 'adaptiveResize')
{
global $SITEURL;
if(empty($item->image[$id])) return;
if(!file_exists(GSROOTPATH.$item->image[$id])) return;
$relpath = dirname(@$item->image[$id]);
$path = dirname(GSROOTPATH.$item->image[$id]);
$base = basename(GSROOTPATH.$item->image[$id]);
if(!file_exists($path.'/thumbnail/'.$width.'x'.$height.'_'.$base)) {
$thumb = \PhpThumbFactory::create(GSROOTPATH.$item->image[$id]);
$path_parts = pathinfo(GSROOTPATH.$item->image[$id]);
$thumb->{$type}($width, $height);
$thumb->save($path.'/thumbnail/'.$width.'x'.$height.'_'.$base, $path_parts['extension']);
}
return $SITEURL.$relpath.'/thumbnail/'.$width.'x'.$height.'_'.$base;
}
Note that you must pass a SimpleItem as the first parameter.