How do you resize Captionator thumbs

BillWill

Joined: 2008-08-28
Posts: 205
Posted: Thu, 2012-04-05 16:09

They're a bit small for me. Best I could do was adjust the width, which stretched them out beyond recognition.

===========================
Gallery 3.0.2
PHP - 5.3.8 cgi-fcgi
Apache/2.2.21 (Unix)
mysqli 5.0.92
Clean Canvas theme

Toolkits = Exif, Gd, ImageMagick

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25953
Posted: Thu, 2012-04-05 17:34

gallery3/modules/captionator/views/cap....html.php

          <td style="width: 140px">
            <?= $child->thumb_img(array(), 140, true) ?>
          </td>

Adjust the 2 140 #s
if you go much bigger it might require some other adjustments.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
BillWill

Joined: 2008-08-28
Posts: 205
Posted: Fri, 2012-04-06 09:48

Hi Dave -

As you probably suspected, I was trying to modify the thumb sizes in your "tag by group" module. I fiddled with the 140s there, with no luck, and thought maybe it was controlled by captionator.

In both cases, it will allow me to make them smaller, but not larger than the size I set for my thumbs, and I don't want to increase the thumb sizes anywhere else.

Your reply let me know I was looking in the right place, so I tried changing that line in both modules

from this:
<?= $child->thumb_img(array(), 150, true) ?>

to this:
<?= $child->resize_img(array(), 250, true) ?>

It now shows the resized images instead of the thumbs, but won't let me reduce the size.

===========================
Gallery 3.0.2
PHP - 5.3.8 cgi-fcgi
Apache/2.2.21 (Unix)
mysqli 5.0.92
Clean Canvas theme

Toolkits = Exif, Gd, ImageMagick

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25953
Posted: Sat, 2012-04-07 01:35

The resize_img function does not take resizing.
Here is how I would do it for the captionator module the tag_by_group module would be very similar.

In the view add:

  <style>
  .g-caption-resize {
  height: 100%;
  width: 100%;
  }
  </style>

just below or above the <script> or </script> tag.
Add a class the the resize image:
<?= $child->resize_img(array("class" => "g-caption-resize")) ?>
make the table cell wider:
<td style="width: 300px">

So what this does is add a class the the image, the cell is wider and the css tells the image to fill the cell.

adjust the 300 as needed to make the cell wider and the image (with the css) will scale down to fit.

rename the attachment as needed to the proper extension and removing the underscores.

Similar changes to the the tag_by_group module would be very similar.

I'm sure there is a better way but in the time this is what I would do, might not be the right way but it does work.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

AttachmentSize
captionator_dialog.html_.php_.txt3.04 KB
 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25953
Posted: Sat, 2012-04-07 01:46

the above works well in FF
this works better:

  <style>
  .g-caption-resize {
  height: auto;
  width: 100%;
  }
  </style>

Chrome did not like the 100% height.
Your on your own fixing IE if it is borked.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
BillWill

Joined: 2008-08-28
Posts: 205
Posted: Fri, 2012-04-20 00:55

Hello Dave

I just tried this, using the second style, on tag_by_group_dialog.html.php and it works great. Believe it or not, it even works on IE. As you can imagine, the thumbnails load a lot faster than the full size images, which make a big difference when 500 of them load at once. I'll add it to the docs.

Thanks,

-----
ps - just looked at the new code. I see you bumped up the size from 140 to 200.

===========================
Gallery 3.0.2
PHP - 5.3.8 cgi-fcgi
Apache/2.2.21 (Unix)
mysqli 5.0.92
Clean Canvas theme

Toolkits = Exif, Gd, ImageMagick