Welcome, Guest
Username Password: Remember me

Resizing Thumbnails
(1 viewing) (1) Guest
If you need assistance in using JBS version 7.x or above, please be as complete as possible. Also be sure to look at the documentation site first, as it is constantly growing: www.joomlabiblestudy.org/jbsdocs
  • Page:
  • 1

TOPIC: Resizing Thumbnails

Resizing Thumbnails 13 Jan 2012 10:26 #3062

Which page do I need to edit in order to hard code a max width for thumbnail size? I'm using the studies list page as my landing page and I don't want to have to edit every sermon image to a max of 250px width. Any help is greatly appreciated.

collegeparkcog.com/index.php?Itemid=120

Thanks,
Josh

Re: Resizing Thumbnails 13 Jan 2012 15:27 #3063

  • Tom
  • OFFLINE
  • Moderator
  • Posts: 316
THere is a way to do it if you are brave!

Edit the site/components/com_biblestudy/lib/biblestudy.images.class.php file

Notice on lines 53 and 54:

$tmp->width = @$info[0];
$tmp->height = @$info[1];

Now look at line 135

Add lines that will replace what you are getting on lines 53 and 54:

$imagepath->width = 278;
$imagepath->height = somenumber; (of course you have to put a number here)

Test it and see if it works for you. Remember that on update of the component you will have to redo this.

Tom

Re: Resizing Thumbnails 17 Jan 2012 13:51 #3078

Tom,

Thanks for your reply. I've gotten it to work. I had to try a few different things but this finally worked just as I wanted it to. Here is the final code for lines 125 through 132.

$imagepath = array();
$folder = $this->getStudiesImageFolder();
$path = $folder .'/'. $image;
if (substr_count($image,'/')) {$path = $image;}
$imagepath = $this->getImagePath($path);
$imagepath->width = 200;
$imagepath->height = auto;

return $imagepath;

I've added these two lines which I can make any width and the height will auto size accordingly.

$imagepath->width = 200;
$imagepath->height = auto;

You could also use this for the getSeriesThumbnail section but I needed it for the Studies list page which is my landing page.

Again, thanks for your help pointing me in the right direction.
  • Page:
  • 1
Time to create page: 0.79 seconds