Member
Member
binocle   2008-10-25, 21:45
#1

Hi

First, I'm french and my english is really poor so excuse me in advance ;-)

So,
For the gallery of my website I use the new 1.2.1 version of zenhoto

In this gallery, I’ve got several picture sizes and lots of panoramics.
.
The default thumbnails size and scale is 120, so the size of my common pictures thumbmails is 120180 or 180120.

But I’ve got a problem with the proportions of my panoramic pictures. Indeed, a panoramic of 120px high is arround 400px in width and I would like them to be displayed in a max witdh format of 180px.

So I would like to know if it is possible to configure the MAXIMUM dimension of thumbnails or to resize by the longest size rather than by the shortest size like now.

I have seen a website where thumbnails are configured as I would: http://www.boutsdeplanete.com/portfolio/page/search/le_d%C3%A9sert

Could you tell me how I can do this ?

Thanks for your answer
Sincerely

Administrator
Member
Member
olihar   2008-10-26, 15:12
#3

is it good to recommend something that does not currently work, I know you said it has bugs.

There are no news on the CustomAlbumThumbMaxSpace are there?

Administrator
Administrator
acrylian   2008-10-26, 17:35
#4

Yes, that's why I recommended the latest nightly..:-) sbillard has helped out with that recently [svn 2773] and hopefully solved the remaining bugs.

Btw, if you are really waiting for something you could also check here yourself what has been done:
http://www.zenphoto.org/trac/log/trunk

Member
Member
binocle   2008-10-26, 22:13
#5

Thanks, but I've find the solution this morning, I've use the function printCustomSizedImageMaxSpace, but not the nightly.

It looks to work very well.

Thanks:-)

Member
Member
olihar   2008-10-27, 07:07
#6

Hmm, I thought I was up to date on changes.

I put up [2795] and I am getting no change what so ever, the same identical bug.

I have changed so much.. I just want to make 100% sure I am using the right code.

">

Member
Member
olihar   2008-10-27, 07:42
#7

I changed to

">

and for some odd reason it seems to work better... but its still not 100% and its kind of random as before.

EDIT: and it seems the problem is now Only on vertical photos. As for as my testing has gone anyways. Not like just a random every image as before.

Administrator
Administrator
acrylian   2008-10-27, 10:44
#8

You use the right code... Ahrg, these functions are really starting to cause headache...:-(

I don't see the connection the the quotes around the title... We reworked that function completly twice...I am running out of ideas.. Maybe you could try to help by looking at the functions itself?

Member
Member
olihar   2008-10-27, 13:58
#9

I have played around with the code in the template-functions.php for almost 2 hours now.. Always this random thumb error. I recon this has to be somewhere else then in the function printCustomAlbumThumbMaxSpace

and yeah of course mentioning that the problem is the same with video files as it was before.

Member
Member
olihar   2008-10-27, 14:18
#10

I think I cracked it.

Change template-functions.php

Line 1309-1323

From

function printCustomAlbumThumbMaxSpace($alt='', $width=NULL, $height=NULL, $class=NULL, $id=NULL) { global $_zp_current_album; $destshape = $width > $height; $albumthumb = $_zp_current_album->getAlbumThumbImage(); $sourceshape = $albumthumb->get('width') > $albumthumb->get('height'); if ($sourceshape == $destshape) { // the soruce and destination orientations are the same printCustomAlbumThumbImage($alt, min($width, $height), NULL, NULL, NULL, NULL, NULL, NULL, $class, $id); } else{ if ($sourceshape > $destshape) { // landscape to portrait, width is constrained printCustomAlbumThumbImage($alt, NULL, $width, NULL, NULL, NULL, NULL, NULL, $class, $id); } else { // portrait to landscape, height is constrained printCustomAlbumThumbImage($alt, NULL, NULL, $height, NULL, NULL, NULL, NULL, $class, $id); } } }
to

function printCustomAlbumThumbMaxSpace($alt='', $width=NULL, $height=NULL, $class=NULL, $id=NULL) { global $_zp_current_album; $sourcew = $width > $height; $sourceh = $height > $width; if ($sourcew == $sourceh) { // the soruce and destination orientations are the same printCustomAlbumThumbImage($alt, min($width, $height), NULL, NULL, NULL, NULL, NULL, NULL, $class, $id); } else{ if ($sourcew > $sourceh) { // landscape to portrait, width is constrained printCustomAlbumThumbImage($alt, NULL, $width, NULL, NULL, NULL, NULL, NULL, $class, $id); } else { // portrait to landscape, height is constrained printCustomAlbumThumbImage($alt, NULL, NULL, $height, NULL, NULL, NULL, NULL, $class, $id); } } }
EDIT: did some minor tweaks.
EDIT: and of course global $_zp_current_album; shouldn't be needed there any more as well
EDIT: Can it really be this easy?

Administrator
Administrator
acrylian   2008-10-27, 14:40
#11

Oh great, thanks for looking into that! We will take a further look at that. But if it works for you that's great.

Sorry that I forgot to mention about the missing videothumb, we have that not in there because they are a little separate from the normal (also there are some issue with that in general because of the mentioned custom crop feature). I promise they will return once the general function is approved..:-)

Member
Member
olihar   2008-10-27, 14:47
#12

Great. Now its only the video thumb as stated above and the Encoding for International Characters, then I am all set for the time being. I am looking forward to hear about the charset as that is the only thing holding putting the web pages up for the public.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.