Thoughts about simplefying the functions

Although I'm using ZenPhoto now for over a year, I still get very confused about the many different functions there are. I.e. the matter I'm confronted with now is the format of the thumbs, squared, cropped or proportional.

As I understand it now each presentation needs a different function to be placed in the template file (album.php). But why not just call one function that can work with the settings you give in the options page? Much more user friendly.

So a function like printAlbumThumbImage(getAlbumTitle()); imho should present thumbs with dimensions 85x85 cropped if that's what's in the settings, or uncropped and with a longest side of 150 if that's what the settings are, etc. You want the thumbs to be cropped and with a different ratio, then use the ratio given in the options page.

So I was thinking it would be great to have this kind of list/choices in the options page:
1. Cropped square (exact size (width=height))
3. Cropped custom size (width, height)
2. Uncropped/proportional - max. dimension is longest side
According to what choice is made here, the function printAlbumThumbImage(getAlbumTitle()); takes care of it.

I'm just thinking out loud here...

Comments

  • acrylian Administrator, Developer
    Thanks, loud thoughts are appreciated...:-) Generally I agree. But also having these extra functions gives you the flexibility to have different thumb sizes for different albums, not just one global setting.

    We need to figure out to do that without breaking older themes and installations though what can happen if we change the default behaviour. We are considering it and will discuss it.
  • Yes, perhaps these options can be used together. For general sitewise purposes one function to rule them all :) and always a freedom to overule that in someone's custom theme files.
  • What you describe is the way it is supposed to work with the current thumbnails (Not the max size version.) There seems a bug with #2. (Ha, thought you could fool me by putting them out of order!). But with that fixed you can get:

    Thumb Crop set:
    Cropped square--so long as your crop height & width are equal. If the crop value == the thumb size then you will get as much as the image as possible from the crop. If not the crop will be taken from within the image by the percentage difference.

    Cropped by some other aspect ration--just set it.

    Thumb Crop not set:
    Thumb will be based on thumb size. Image will be fit based on the longest side.

    If you wan to be fancier than this you will need to use the special functions.
  • Thanks for the explanation. So after the fix I should get what I want simply by using printImageThumb(getAnnotatedImageTitle())? Because with thumbsize set to 100 and not cropped at this moment I get square thumbs of 100x100. That's why for now I use this code to get a temporary fix:

    `
    if (getFullWidth() === getFullHeight() OR getFullWidth() > getFullHeight()) { printCustomSizedImage(getImageTitle(), null, 150, null);
    } else {
    printCustomSizedImage(getImageTitle(), null, null , 150);
    `
    I tried to do the same with the albumthumbs but that did not work and I don't know why:

    `
    if (getFullWidth() === getFullHeight() OR getFullWidth() > getFullHeight()) { printCustomAlbumThumbImage(getAlbumTitle(), null, 150, null);
    } else {
    printCustomAlbumThumbImage(getAlbumTitle(), null, null , 150);
    `
    Will there be an small announcement here on the forum when I fix for this is available?
  • The current nightly has some fixes. Not sure about the album thumb image, though. I will have to look into it. Might be fixed but I am not sure.
  • Funny, I just posted a topic about those changes in the nightly, but you must have missed that one :). I downloaded the nightly and uploaded only those two changed files to my 1.2.2 installation, template-functions.php and functions-image.php, but this still gives me only square cropped thumbs with the standard code printImageThumb(getAnnotatedImageTitle().
  • Be sure you have purged your cache. The image thumbs are working for me.
  • Purge the cache? Why should I?
    Because Jack (me real name), then everything works as it is supposed to be :=)...

    Both the imagethumbs and albumthumbs show up fine now. Thanks a lot! :)
  • Funny thing about caches. They remember things even when we wish they would not.
Sign In or Register to comment.