Different size album thumbnails?

Brandan

Joined: 2010-09-05
Posts: 8
Posted: Wed, 2014-01-15 09:13

I am creating a custom theme. For the root album I am coding a slideshow with the album cover from each of the child albums.

What is the easiest way to get a bigger image to use in the slide show?
[I know my way around php, but I am no expert]

The first way I thought of is to just make the album thumbnails bigger. I found http://galleryproject.org/node/98870 talking about doing just that. I have installed it, but have not been able to get it to change the size of anything.(It did rebuild all of my thumbs, but they are the same size as before. I tried changing custom_albums -->thumb_size under advanced and that did not seem to change anything either.

The other way that I can see to get what I need is instead of using the cover thumb, get the item id that is used as a cover and use its resized image(that is what I really want anyway).

Any thoughts or suggestions?

Thanks

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2014-01-16 00:37

If you want bigger thumbs you go to admin ->appearance -> theme options.
Or are you wanting to use the resize, there is no resize size fo rthe album highlights.
I don't see any docs for the that module and have not tested it.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Brandan

Joined: 2010-09-05
Posts: 8
Posted: Thu, 2014-01-16 07:26

Thanks for your reply. Looks like you pretty much hit the same wall I did. Starting to think it might be easiest to code a module that lets the person select their own special photos for the slideshow, then I can have it grab the links to the bigger size of the correct photo that way.

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sat, 2014-02-15 03:34

A few ways to do this, depending on where you're placing the code and a few other things.

What is the code that you're using to get the album covers?

 
Brandan

Joined: 2010-09-05
Posts: 8
Posted: Sat, 2014-02-15 07:10

Currently I am using a custom theme and I am using this code which is in the views/page.html.php file in such a way that it will only show on the front page.

<? foreach ($children as $i => $child): ?> 
   <? if ($child->is_album()): ?>
     <div class="cover" >
     <a  href="<?= $child->url() ?>"><img class="coverthumb"  src="<?= $child->thumb_url() ?>" />
     <?= html::purify($child->title) ?></a><br>
     </div>
   <? endif ?>
<? endforeach ?>

I am not stuck on doing it this way from this file. If there is another way I am happy to give it a try.

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sat, 2014-02-15 07:41

Try:

<? foreach ($children as $i => $child): ?> 
   <? if ($child->is_album()): ?>
     <div class="cover" >
     $cover=ORM::factory("item")->where("id", "=", $child->album_cover_item_id)->find();
     <a  href="<?= $child->url() ?>"><img class="coverthumb"  src="<?= $cover->resize_img() ?>" />
     <?= html::purify($child->title) ?></a><br>
     </div>
   <? endif ?>
<? endforeach ?>

(I haven't actually tested this.)

 
Brandan

Joined: 2010-09-05
Posts: 8
Posted: Sat, 2014-02-15 08:48

I tried your code as is and it printed it on the screen. I added php tags around the 4th line and the code does it thing. The link it makes goes to './%3Cimg/%3E'

Here is the code that I ran.

<div id="cover">
<? foreach ($children as $i => $child): ?> 
<? if ($child->is_album()): ?>
<div class="cover" >
  <? $cover=ORM::factory("item")->where("id", "=", $child->album_cover_item_id)->find(); ?>
     <a  href="<?= $child->url() ?>"><img class="coverthumb"  src="<?= $cover->resize_img() ?>" />
     <?= html::purify($child->title) ?></a><br>
</div>
<? endif ?>
<? endforeach ?>
 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sat, 2014-02-15 14:28

Ha! My mistake; totally forgot to add the "<?" and "?>"

wrote:
the code does it thing. The link it makes goes to './%3Cimg/%3E'

I don't understand. I'm assuming that you're saying it doesn't work?

Try:

<div id="cover">
<? foreach ($children as $i => $child): ?> 
<? if ($child->is_album()): ?>
<div class="cover" >
  <? $cover=ORM::factory("item")->where("id", "=", $child->album_cover_item_id)->find(); ?>
     <a  href="<?= $child->url() ?>"><img class="coverthumb"  src="<?= $cover->resize_url() ?>" />
     <?= html::purify($child->title) ?></a><br>
</div>
<? endif ?>
<? endforeach ?>

Again, I haven't tested.

 
Brandan

Joined: 2010-09-05
Posts: 8
Posted: Sat, 2014-02-15 23:53

It works! Is there an easy way to explain how it does what it does?

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sun, 2014-02-16 06:06

Basically just queries the database to look for the album cover and then sends back the url to the resize version of that cover.
Not sure if you can see that in the code or not. It gets easier to see the more you code with it.
If you develop a theme that you wouldn't mind sharing back, I'm sure the community would be grateful.