Pages (2): 1 2   
Junior Member
Junior Member
c-unit   25-04-2007, 00:03
#1

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.

Developer
Developer
trisweb   25-04-2007, 01:07
#2

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.

Member
Member
jimhere   15-10-2007, 20:03
#3

Even though this is an old post, thanks for the tip. Unchecking "Crop thumbnails" in the admin didn't do anything, but editing zp-config.php did. (also applies to image size)

...should the 'zen' folder also be 777'd?

Member
Member
AlexWilson   18-12-2007, 19:06
#4

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 
Member
Member
pdm   06-03-2008, 08:18
#5

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.

Member
Member
fardanaz   09-03-2008, 19:12
#6

Hi,

I´ve been trying to do something (in theory simple) with thumbnails but with no luck:

  1. Fixed size in both dimensions so gallery looks like a regular grid
  2. No cropping

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

Administrator
Administrator
acrylian   09-03-2008, 20:47
#7

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...

Member
Member
macalter   10-03-2008, 04:47
#8

I tried to find the section in i.php mentioned above by Alex but coudn't. I too want exactly what c-unit explains in his/her post.

Member
Member
fardanaz   10-03-2008, 15:39
#9

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

Administrator
Administrator
acrylian   10-03-2008, 16:57
#10

@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.

Member
Member
peterhebert   26-03-2008, 01:43
#11

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.

Member
Member
sbillard   26-03-2008, 03:39
#12

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.

Member
Member
steadingman   12-05-2008, 07:24
#13

Hello,

I found such resolution, no need zenphoto core hack:
`

[img][/img]`

or with next_image() loop:

`

">



    [img][/img]

`

Member
Member
steadingman   12-05-2008, 07:31
#14

ah yes, more clear:
`

[img][/img]`

Junior Member
Junior Member
MiguelCaroline   30-05-2008, 05:31
#15

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.

Administrator
Administrator
acrylian   30-05-2008, 09:25
#16

Sorry, this is the forum for Zenphoto, not Picasaweb. Our documentation is found on our user guide page...

Member
Member
Adagio   30-05-2008, 15:36
#17

So I'm looking at Options>Image Display for the thumbnail scaling options and see none. I thought they were there yesterday. What am I missing?

Administrator
Administrator
acrylian   30-05-2008, 15:44
#18

These are under the "theme options" tab.

Member
Member
Adagio   30-05-2008, 16:12
#19

Duh. Thanks, acrylian.

Member
Member
Bilder-Freak   27-08-2008, 10:30
#20

Searched a long time for this - thanks!

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.