Thumbnail Size

Permalink Browser Info Environment
I was wondering if it would be possible to adjust the controller file so the thumbnail size will crop the image to 150x150.


Type: Discussion
Status: Resolved
View Replies:
C5ThemeTeam replied on at Permalink Reply
How strange, I was coming in here to ask the exact same question.
ahein624 replied on at Permalink Reply
No Thoughts? Or Comments?
mobius2000 replied on at Permalink Reply
Hi guys, I know I'm a bit late to the party but I just had to achieve the same thing you were both asking for... If you didn't manage to get it, here is what I did.

On line 49 of the crontroller.php file you will find this:
if ($this->enableLightbox) {
               $thumb = $ih->getThumbnail($file, $this->thumbWidth, $this->thumbHeight);
               $image['thumb_src'] = $thumb->src;
               $image['thumb_width'] = $thumb->width;
               $image['thumb_height'] = $thumb->height;
               $max_row_height = ($thumb->height > $max_row_height) ? $thumb->height : $max_row_height;

I simply removed out the $thumb_width and $thumb_height lines and placed the following it's place:

$thumb = $ih->getThumbnail($file, 250, 250, true);

This will of course set it's width and height to 250px and crop where needed to make it happen.

Full controller.php pasted below:
   defined('C5_EXECUTE') or die(_("Access Denied."));
   class SortableResponsiveGalleryBlockController extends BlockController {
      var $pobj;
      protected $btDescription = "Displays images in a fileset (with an optional lightbox), and allows you to change their display order via drag-and-drop.";
      protected $btName = "Sortable Responsive Gallery";
      protected $btTable = 'btSortableResponsiveGallery';
      protected $btInterfaceWidth = "800";
      protected $btInterfaceHeight = "480";
      public function on_page_view() {
         if ($this->enableLightbox) {
            $html = Loader::helper('html');            
            $bv = new BlockView();
            $this->addHeaderItem($html->css($bv->getBlockURL() . '/responsive/jquery.fancybox-1.3.1.css', null, array('handle' => 'jquery.fancybox', 'version' => '1.3.1')));

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.