I am using a Highslide addon to a CMS (Concrete5) I’m implementing. I need the thumbnails to crop to a set height, but cannot find in the PHP where to add it…
[php]
<?php /* * Functions for showing your images (or imageset) with teh use of Highslide. * Within your Concrete 5 website with the use of Highslide http//:highslide.com * @author Wim Bouter */ defined('C5_EXECUTE') or die(_("Access Denied.")); Loader::model('file_version'); $thumb_attribute = $controller->thumb_attribute; $thumb_width = $controller->thumb_width; $thumb_width_crop = $controller->thumb_width_crop; $max_width = $controller->max_width; $max_width_crop = $controller->max_width_crop; $dimming = $controller->dimming; $dimmingopacity = $controller->dimmingopacity; if (strlen($dimmingopacity) == 1) $dimmingopacity = '0'.$dimmingopacity; $credits = $controller->credits; $credits_title = $controller->credits_title; $credits_text = $controller->credits_text; $credits_url = $controller->credits_url; $alttags = $controller->alttags; $alttags_title = $controller->alttags_title; $alttags_attribs = $controller->alttags_attribs; $selected_attributes = $controller->selected_attributes; $images = $controller->images; $f = $t = Loader::helper('file'); foreach($images as $imgInfo) { $captions = ''; $caption = ''; $cap = ''; $f = $t = File::getByID($imgInfo['fID']); $fp = $tp = new Permissions($f); $fv = $tv = $f->getApprovedVersion(); $image_size = $thumb_size = @getimagesize($_SERVER['DOCUMENT_ROOT'].$f->getRelativePath()); if (intval($thumb_attribute) == 1) { $attrib = FileAttributeKey::getByHandle('thumbnail'); if (is_object($attrib)) { $vo = $f->getAttributeValueObject($attrib); if (is_object($vo)) { $file = $vo->getValue($attrib->akHandle); $t = File::getByID($file->fID); $tp = new Permissions($t); $tv = $t->getApprovedVersion(); $thumb_size = @getimagesize($_SERVER['DOCUMENT_ROOT'].$t->getRelativePath()); } } } if ($thumb_size[0] > $thumb_width) { $mw = $thumb_width > 0 ? $thumb_width : $thumb_size[0]; if ($thumb_width_crop != ' 124px"') $mh = $thumb_width; else $mh = round(($thumb_size[1] / $thumb_size[0]) * $mw); $ih = Loader::helper('imageresizer', 'highslide_web_albums'); $thumb = $ih->getThumbnail($t, $mw, $mh, $thumb_width_crop); $sizeStr = ' width"' . $thumb_width . ' height"' . $mh . '"'; $relPathThumb = $thumb->src; } else { $sizeStr = $thumb_size[3]; $relPathThumb = $t->getRelativePath(); } if ($image_size[0] > $max_width) { $mw = $max_width > 0 ? $max_width : $image_size[0]; if ($max_width_crop != 0) $mh = $max_width; else $mh = round(($image_size[1] / $image_size[0]) * $mw); $ih = Loader::helper('imageresizer', 'highslide_web_albums'); $thumb = $ih->getThumbnail($f, $mw, $mh, $max_width_crop); $relPathMax = $thumb->src; } else { $relPathMax = $f->getRelativePath(); } echo(''."\n";
if ($alttags_title)
$caption .= '
'."\n"; $caption .= '
'."\n";
}
echo (''.$cap['title'].'
'."\n";
$caption .= ''.$cap['value'].'
'."\n";
if ($alttags_title)
$caption .= ''."\n"; $caption .= '
'.$caption.'
'."\n\n");
}
}
}
if (!defined('HIGHSLIDE_LOADED')) {
define('HIGHSLIDE_LOADED', true);
?>
<?php } ?>
[/php]