Thumbnail help please

Hi there,

Thanks for creating such a great app.

I have a couple of questions. I have read around and found related threads but not been able to understand the answers or where the various code snippets go etc

1. I created some 100 x 100 thumbnails on the desktop and added the _100 to the image name and ftped them into the appropriate folders within the cache directory (after clearing the cache via the admin interface) however zen photo continued to make it's own thumbnails from the larger images. Can someone explain blow by blow how I get zenphoto to use my thumbnails that are created by me and uploaded rather than generating it's own. As I really need the heads of people to remain intact.

2. I tried turning cropping off but I have a wide range of images that I'm using - their sizes vary a lot and I get such an assortment of thumbnails if I leave them uncropped that the gallery looks plain ugly. Can someone explain clearly what code would need to go into what file - if their is a hack that would enable me to set a max size for both height and width. As if all thumbnails would be either 125px wide or 125px high then I could handle that with css.

I really like this app but I am going to have to go back to Gallery 2 if there is no easy way to tidy up the appearance of the thumbnails that still allows people to keep their heads attached to their bodies :-(

Thanks in advance for any help

Comments

  • cesc Member
    Ok I've sorted out how to manually add thumbnails and have zenphoto use them so that's good... one down. However I'm still stuck on the second issue of how to come up with a standard landscape and portrait size for non-cropped thumbnails.

    Thanks again.
  • Is this page something like you want to avoid?
    http://www.spoenk.nl/beeldend/fotografie/natuur/zaden-pitjes/

    It's my 'ugliest' page because of the different sizes of thumbs, but I don't know how to avoid this. I know you can crop 'manually' with getCustomAlbumThumb (goes for images too), but I have no experience with this.

    http://www.zenphoto.org/documentation/zenphoto/_template-functions.php.html
  • acrylian Administrator, Developer
    Ttry this within the next_image() or next_album() loop on album.php/index.php to get thumbs within fixed dimensions (in this example 150x150px):
    `if (getFullWidth() === getFullHeight() OR getFullWidth() > getFullHeight()) { printCustomSizedImage(getImageTitle(), null, 150, null);

    } else {

    printCustomSizedImage(getImageTitle(), null, null , 150);

    }

    `
    For album thumbnails there are separate functions like `printCustomAlbumThumbImage()`.

    It is on the list (at least on mine) to add this as default behaviour if cropping is turned off, too.
  • cesc Member
    Thank you acrylian :-)

    Ok sorry to be a dimwit but can you tell me two things and then I shall go away and try not to bother you anymore :-)

    1. In the album.php or image.php what is the code that should immediately precede the snippet you have advised me to insert... I want to make sure I am putting it in the right place and I don't know php at all sorry.

    2. Will this fix the thumbs in the albums - as that's what I'm trying to fix or should I be modifying the printCustomAlbumThumbImage() in some way

    Sorry, I know it must be hard to have to support people like me that are fairly clueless

    Thanks again.
  • "It is on the list (at least on mine) to add this as default behaviour if cropping is turned off, too."...

    Great!... :=) And, if possible, print the actual size information of the images/thumbs inside the img source tag. That would make it easier to style and position the images/thumbs with css.
  • acrylian Administrator, Developer
    @cesc: The code I posted can be used for the sized image (on image.php) to replace the printDefaultSizeImage() call or the thumbnails within an album to replace the printImageThumb() call.
    For the album thumbnails (the one for an album) you need to use printCustomAlbumThumbImage() instead of printCustomSizedImage().

    Please take a look at our theming tutorial to get a little familiar with zenphoto's general theme structure: http://www.zenphoto.org/2008/05/theming-tutorial/
  • acrylian Administrator, Developer
    @jackdaw: And, if possible, print the actual size information of the images/thumbs inside the img source tag. That would make it easier to style and position the images/thumbs with css.
    I know this is recommended so that browser can better render the page, but what has that to do with CSS styling? Probably I miss something.
  • cesc Member
    Thanks acrylian. I got it to work but what is happening is that some thumbnails are 150 high and others are 150 wide but as some that are scaled to 150 wide are showing as 208 high or 189 high etc etc - it's still a mess and I can't present a gallery of 150 by 150 squares with the picture fitting in either portrait or landscape - so I am going to have to go back to Gallery 2 because I will be adding dozens of photos week in and week out as my site is sports related - and theres no point in software like this for me if I have to create manual thumbnails for everything.

    Zen photo is excellent I can see that and it is so close to being a solution for me but the gallery has to line up without players losing their heads.

    Thanks anyway :-)
  • acrylian Administrator, Developer
    I just did a test again and my code from above is working for me with the thumbnails (those in the album), but it is somehow not with the album thumbnails. I must admit that hack was actually made for the sized image on image.php and did not test it with album thumbs. I don't know those functions should actually work the same... Guess I have some investigation to do before I can make this as an option...

    No problem, Gallery is not a bad program at all..:-)
  • Hello acrylian, about my reply and suggestion for the printing of the actual size information of the images/thumbs inside the img source tag...

    I made a quick sample to show you what I mean. In this example it is fairly easy to center thumbs/images which are not square both horizontally and vertically. This way custom sized thumbs could be used within a floating design:
    http://www.spoenk.nl/public/test.html
  • acrylian Administrator, Developer
    OK, thanks. Of course I know that you had this in mind. I just was not aware that the img tag parameters do indeed have an effect on css positioning. We will add that.
Sign In or Register to comment.