I would like to make my thumbnails stay in their correct proportions, and always have the longest side resizes to 125px.
So if an image was 500x750 the thumbnail would be be 84x125.
If an image is is 750x500 the thumbnail will be 125x84.
Could someone help me!
Thanks!
Cooper
PS. I searched and browsed, and I feel like this has been discussed before, but I couldn't find a clear and concise description.
zp-config.php, the image thumbnail options are near the bottom. Just set the crop setting to false!
Some themes (eg: stopdesign) may override this if they have special design requirements, so those would require going into the theme code (and probably the HTML/CSS design) to change.
Hi!
I'm just starting in on doing another new gallery display, so I'm just checking out the new 1.1 release. Great work!
As for thumbnails, I ran into this issue myself, and thought I'd share my solution.
In a nutshell, if I've got "Images size is longest size" checked yes, and "Crop thumbnails" unchecked in the admin / options / image display settings, I would expect to have the images uncropped, and scaled to fit within the thumb size. To do this, you just need a little change to i.php
Add this line to the "Set the config variables for convenience" section at the top:
`
$thumb_crop = getOption('thumb_crop');
`
Then find this line:
`
if ((!$thumb && $size && $image_use_longest_side && $h > $w) || ($thumb && $h ($w/$h) ){
$newh = $ch;
$neww = $w*($ch/$h);
}else{
$neww = $cw;
$newh = $h*($cw/$w);
}
$crop=0;
} else if ((!$thumb && $size && $image_use_longest_side && $h > $w) || ($thumb && $h
This behavior was not intuitive to me at all. I would expect if I specify a thumbnail size with a single value, I would be specifying the maximum dimension of any side, not the minimum. There is no predictability with specifying the size of the shortest side, or at least there shoul be some option to specify what you want in the config area and make it obvious what you are getting. Thanks Alex for your suggested patch, i'll try it out.
Hi,
I´ve been trying to do something (in theory simple) with thumbnails but with no luck:
This means images have to be scaled and padded to fit thumb size. I´ve checked several threads but none of the proposed solutions seems to work with ZenPhoto 1.1.5 (note i.php has changed completely so above hack no longer applies).
Please help. BTW, shouldn't this be the default behavior if crop is disabled and thumb sizes are specified?
Thanks in advance,
Fede
No, the longest side is taken as size. How do you want to fix both dimension for a grid, it will never look like a symmetrical grid. You could adjust the css surrounding the thumbs.
Or you try modifiying album.php with this function: http://www.zenphoto.org/documentation/Zenphoto/_template-functions.php.html#functionprintCustomSizedImageMaxHeight
But since that relies on the sized images size and not the thumbnail size, you probably should use this or the printCustomSizedfunction on image.php, too.
Anyway, I guess I should modify the printCustomSizedImageMaxHeight with an option for the width...
Hi acrylian, thanks for the quick replay.
I've been already playing with the getCustom* functions but as far as I could see they do not add any padding on the images, so you either get the size you want in one dimension or you get a deformed image (obviously). So probably the best thing to do would be to workaround this on the CSS. I have little experience with CSS, do you know of any example around doing something similar? Thanks,
--f
@macalter: Set the thumbnails in the admin to not cropping.
@fardanz: Of course that function does not add padding to the images. That is the job of CSS. Please understand that we can't teach the basics of CSS here, since this is not a specific zenphoto issue. Please refer one of the many resources on the web.
I had this hack working in 1.1, but 1.15 seems to have changed the i.php file, taking the resizing out and putting it into the function 'cacheGalleryImage' in functions-image.php. I cannot seem to get it working the same. Could you post where and what to change to get the proportional, non-cropped thumbnails working? Thanks.
Your best bet is to use the customsized image function(s) to create your thumbs. Hacking the zenphoto core is bound to cause you problems like you just experienced. That said, The code that got moved is really unchanged but for the location, so you could just re apply your hack to the code in its new locations.
Hello,
I found such resolution, no need zenphoto core hack:
`
[img][/img]`
or with next_image() loop:
`
">
[img][/img]
`
ah yes, more clear:
`
[img][/img]`
According to spec http://code.google.com/apis/picasaweb/reference.html#Parameters
thumbsize parameter can be cropped or uncropped up to 800px size. But
400c size is not allowed (biggest allowed cropped size is 160c).
For example, request http://picasaweb.google.com/data/feed/api/user/greeceru/album/test?th...
says "thumbsize: That is not one of the acceptable values".
Did I something wrong? Thanks.
Searched a long time for this - thanks!