Highslide Thumbnail Image Cropping...

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 && sizeof($selected_attributes) > 0) { if ($alttags_title) $size = '_small'; else $size = '_large'; foreach ($selected_attributes as $sa) { $attrib = FileAttributeKey::getByHandle($sa); if (is_object($attrib)) { $vo = $f->getAttributeValueObject($attrib); if (is_object($vo)) { $captions[] = array('title' => $attrib->akName, 'value' => $vo->getValue($attrib->akHandle)); } } elseif ($sa == 'fvFileID' && trim($fv->getFileID()) != '') $captions[] = array('title' => substr($sa, 2), 'value' => $fv->getFileID()); elseif ($sa == 'fvFilename' && trim($fv->getFileName()) != '') $captions[] = array('title' => substr($sa, 2), 'value' => $fv->getFileName()); elseif ($sa == 'fvSize' && trim($fv->getSize()) != '') $captions[] = array('title' => substr($sa, 2), 'value' => $fv->getSize()); elseif ($sa == 'fvDateAdded' && trim($fv->getDateAdded()) != '') $captions[] = array('title' => 'Date Added', 'value' => $fv->getDateAdded()); elseif ($sa == 'fvTitle' && trim($fv->getTitle()) != '') $captions[] = array('title' => substr($sa, 2), 'value' => $fv->getTitle()); elseif ($sa == 'fvDescription' && trim($fv->getDescription()) != '') $captions[] = array('title' => substr($sa, 2), 'value' => $fv->getDescription()); elseif ($sa == 'fvTags' && trim($fv->getTags()) != '') $captions[] = array('title' => substr($sa, 2), 'value' => $fv->getTags()); elseif ($sa == 'fvAuthor' && trim($fv->getAuthorName()) != '') $captions[] = array('title' => substr($sa, 2), 'value' => $fv->getAuthorName()); elseif ($sa == 'fvDownload') $captions[] = array('title' => substr($sa, 2), 'value' => 'Download File'); } if (is_array($captions) && sizeof($captions) > 0) { foreach($captions as $cap) { $caption .= '
'."\n"; if ($alttags_title) $caption .= '
'.$cap['title'].'
'."\n"; $caption .= '
'.$cap['value'].'
'."\n"; if ($alttags_title) $caption .= '
'."\n"; $caption .= '
'."\n"; } echo ('
'.$caption.'
'."\n\n"); } } } if (!defined('HIGHSLIDE_LOADED')) { define('HIGHSLIDE_LOADED', true); ?> <?php } ?>

[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service