Thumb size MaxSpace and + ZenPage Question

I have problems with the
`
<?php printCustomAlbumThumbMaxSpace(getAlbumTitle(),200,200); ?>
`
see here in this dummy gallery I am working on to put on my main page when ready.

http://www.olihar.com/album/

Screenshot
http://img.skitch.com/20081011-g9dgaytk5jgfw454rusa8p5hwu.jpg

if you do a refresh few time you will see sometimes the thumbs are bigger then they should be, for some odd reason.

ZenPage Question...

Is it possible to use Iframes when posting? The reason I am asking is I have some panoramas in Zoomify I would like to manually put Google maps to it like I have on my current web page.

I did try few times with iFrames with no luck

see here.

http://www.olihar.com/album/pages/Hafnarfjordur

or would you suggest some other way of implementing manual Google maps with these photos

this is how its now on my old page.
http://olihar.com/gallery/index.php?p=pano01_001

Comments

  • acrylian Administrator, Developer
    1. Hm, I fixed some issues with the maxspace functions recently I thought... Seems it is not using the right cache image somehow. I will take a look.

    2. I see actually no reason why iFrames should not work with the codeblocks. Any kind of code should be possible. But why don't you leave the images in the album as on the old site? Do they need to be a post?
    I can't really help with Google Maps in general, I never used them and do not know how the code works.
  • 1.
    I might try with deleting all the files and put up new ones and see what happens, I have tried clearing the cache few times but same results.

    2.

    When I put iFrame into codeblock and I save it changes the code from

    `


    `
    to

    `
    rn
    `

    The reason I want to change from how it is to being pages is all the manual work involved in making these pages and links.
  • I found how to get past the iframe problem. `"` is not allowed in the codeblock

    if `"` is deleted and left with nothing, like so.

    `
    `

    it works just fine.

    I am getting to love ZenPage.
  • acrylian Administrator, Developer
    Thanks!

    Good that you solved it. Sorry, I forgot to mention/think of that only single quotes can be used. I will add it both to the FAQ on the project site and to the comment in Zenpage itself.

    Btw, did you try that code within TinyMCE? Actually it is just html so it might work even there (the google video on hte project site is just within that.)
  • ahh sorry your answer just slipped me. Yeah I did try the code in TinyMCE.. The best result was to use it in the codeblock.

    Have you managed to look into the

    `<?php printCustomAlbumThumbMaxSpace(getAlbumTitle(),200,200); ?>`

    I am still getting these funky sizes as thumbs mainly on the index page. It never happens with the ImageThumbMaxSpace only the Album one.
  • acrylian Administrator, Developer
    Have you ever tried to use the normal printCustomThumbImage() setting just a size? Then actually Zenphoto should make the size after the longest side. The maxspace functions are actually best suited for none square images (although I admit it should work actually).
  • I think I will just go back to the standard way of doing things for now as the other options are not reliable as of now.

    `
    " title="<?php echo gettext('View album:'); ?> <?php echo getAnnotatedAlbumTitle();?>"><?php printAlbumThumbImage(getAnnotatedAlbumTitle()); ?>
    `
    EDIT: I am getting these strange thumbs cache bugs now as well with this standard way of doing things. I have done Purge cache and rebuild as well.
  • EDIT: again... I think its better to go to sleep I forgot to but the old way into album.php and of course I was getting the same errors. Well I guess I will keep it like this for now untill the other settings have been fixed, if possible.
  • When Using the standard function the thumbs come out in many different ways. if one is cropped as a panorama or a very high one it goes all over the place.

    `
    <?php printCustomAlbumThumbMaxSpace(getAlbumTitle(),200,200); ?>
    `
    is the perfect solution I am looking for, if not looked at the 2 bugs I have reported about it, the random cache as stated here before and the problem with the video files.

    I Decided to have a better look at the Custom(Album)ThumImage.

    `
    <?php printCustomAlbumThumbImage(getAlbumTitle(),NULL, '200' , '200', NULL, NULL, NULL, NULL); ?>
    `
    When this is used I get a 200px crop, crop is something I am trying to get away from as it cuts the photos in many ways, especially people's heads off on the thumbs.

    When used with only height or width I get very bad results as there are mix between the portrait and landscape photos in the same folder.

    What I have been looking into the printCustomAlbumThumbMaxSpace is how it creates the thumbs. I have found it interesting at how random it picks if it puts the given number to width or height. We say the given number is '200' sometimes it makes thumbs in the sizes 200x280 , 300x200 , 299x200, 356x200, 200x300.

    I had a little look at the code...

    `
    function printCustomAlbumThumbMaxSpace($alt='', $width=NULL, $height=NULL, $class=NULL, $id=NULL) {
    global $_zp_current_album;
    $albumthumb = $_zp_current_album->getAlbumThumbImage();
    $albumdata = $albumthumb->data;
    $fullwidth = $albumdata['width'];
    $fullheight = $albumdata['height'];
    $percentuser = $width / 100;
    $heightpercent = round($height / $percentuser);
    $fullpercent = $fullwidth / 100;
    $fullheightpercent = round($fullheight / $fullpercent);
    if($fullwidth === $fullheight OR $fullheightpercent > $heightpercent) {
    printCustomAlbumThumbImage($alt, NULL, null, $height, NULL, NULL, NULL, null, $class, $id);
    } else {
    printCustomAlbumThumbImage($alt, NULL, $width, null, NULL, NULL, NULL, null, $class, $id);
    }
    }
    `
    Just a quick question is all this math necessary?

    The only thing that is needed is saying

    `
    if width > height in the original THUMB
    print the width into the thumb and leave height out.
    else print the height into the thumb and leave width out.
    `
    or

    `
    if width > height in the original IMAGE
    print the width into the thumb and leave height out.
    else print the height into the thumb and leave width out.
    `
    Or is this whole problem related to the cache.

    I have been playing around with this a little bit but not really found any thing out of the ordinary.
    `
    function printCustomAlbumThumbMaxSpace($alt='', $width=NULL, $height=NULL, $class=NULL, $id=NULL) {
    global $_zp_current_album;
    $albumthumb = $_zp_current_album->getAlbumThumbImage();
    $albumdata = $albumthumb->data;
    $fullwidth = $albumdata['width'];
    $fullheight = $albumdata['height'];

    if($fullheight > $fullwidth) {
    printCustomAlbumThumbImage($alt, NULL, null, $height, NULL, NULL, NULL, null, $class, $id);
    } else {
    printCustomAlbumThumbImage($alt, NULL, $width, null, NULL, NULL, NULL, null, $class, $id);
    }
    }
    `
  • EDIT: as I couldn't edit the one above
    Well it doesn't really matter what I force into this code the problem stays the same.

    Like
    `
    $fullwidth = '50';
    $fullheight = '100';
    `
    it makes no difference even with the changed code I had here before. witch sound a bit strange to me as that should force it to at least go one way of the rule. Maybe I am just making up stuff I don't know.
  • acrylian Administrator, Developer
    Actually you are right and I had it that way before but it some how failed sometimes. I did just some tests with the album thumb and somehow it does sometimes work and sometimes not, both landscape and portraits are every once a while too big. Just as you had reported, too.

    But the good news is I think I found why it does that! The original function `printCustomAlbumThumbImage` does add a either a height or a width attribute to the img tag that is printed. That seems to cause the funny results. I threw that out for testing and now it seems to work. These atributes are actually there for the defaultimage.png if there is no actual thumb so that it fits since it is not cropped...

    EDIT: You can try it yoursefl. The function is in line 1240 of template-functions. Set $sizing to "" in the if/else construct and see if it solves that for you, too
  • I just tried. And as far as I can see it this has no effect.
  • acrylian Administrator, Developer
    I fear to ask, but did you clear the image cache and the browser cache?
  • Yes I did both... There is something I think I totally forgot to mention. This random cache error is only on

    `printCustomAlbumThumbMaxSpace`

    When I go into folders or subfolders with images and no folders everything is just fine it seems.

    When ImageMaxSpace is used.

    `printCustomSizedImageMaxSpace`

    You can have a look here in this dummy I put up.

    http://www.olihar.com/chris/
  • acrylian Administrator, Developer
    OK, I was only talking about the album thumb actually..

    I see somehow the function use sometimes width when it should use height. Don't know why, that must lay in the internal class functions I am, I have to admit, not that familiar with. I have to consult sbillard on that, I guess.

    EDIT: A thing I forgot to mention is that I not only set $sizing="" but also added the $height/$widht within the albumthumbmaxspace one also to the size paramenter like this `printCustomAlbumThumbImage($alt, $height, null, $height, NULL, NULL, NULL, null, $class, $id);`.
    This seems to help... Please try that, too (we try anything these days, do we..:-))
  • Well funny enough it looks like it makes a "small" difference....

    but no fix, tough. it only makes the error thumbnails have worse quality.
  • Has Sbillard had the time to take a quick look at this problem?
  • acrylian Administrator, Developer
    Not yet since we were working on cropping functionality in general (keyword: custom cropping!). We will look at this but you need to be a little patient...:-)
  • No worries. I will be on the lookout. thanks.
Sign In or Register to comment.