ZenphotoCMS Forum
How do I make uncropped (full proportion) thumbnails? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: Themes (https://forum.zenphoto.org/forum-5.html)
+--- Thread: How do I make uncropped (full proportion) thumbnails? (/thread-1389.html)

Pages: 1 2


How do I make uncropped (full proportion) thumbnails? - c-unit - 25-04-2007

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.




How do I make uncropped (full proportion) thumbnails? - trisweb - 25-04-2007

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.




How do I make uncropped (full proportion) thumbnails? - jimhere - 15-10-2007

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?




How do I make uncropped (full proportion) thumbnails? - AlexWilson - 18-12-2007

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 



How do I make uncropped (full proportion) thumbnails? - pdm - 06-03-2008

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.




How do I make uncropped (full proportion) thumbnails? - fardanaz - 09-03-2008

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




How do I make uncropped (full proportion) thumbnails? - acrylian - 09-03-2008

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




How do I make uncropped (full proportion) thumbnails? - macalter - 10-03-2008

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.




How do I make uncropped (full proportion) thumbnails? - fardanaz - 10-03-2008

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




How do I make uncropped (full proportion) thumbnails? - acrylian - 10-03-2008

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




How do I make uncropped (full proportion) thumbnails? - peterhebert - 26-03-2008

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.




How do I make uncropped (full proportion) thumbnails? - sbillard - 26-03-2008

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.




How do I make uncropped (full proportion) thumbnails? - steadingman - 12-05-2008

Hello,

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

[img][/img]`

or with next_image() loop:

`

">



    [img][/img]

`




How do I make uncropped (full proportion) thumbnails? - steadingman - 12-05-2008

ah yes, more clear:
`

[img][/img]`




How do I make uncropped (full proportion) thumbnails? - MiguelCaroline - 30-05-2008

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.




How do I make uncropped (full proportion) thumbnails? - acrylian - 30-05-2008

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




How do I make uncropped (full proportion) thumbnails? - Adagio - 30-05-2008

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?




How do I make uncropped (full proportion) thumbnails? - acrylian - 30-05-2008

These are under the "theme options" tab.




How do I make uncropped (full proportion) thumbnails? - Adagio - 30-05-2008

Duh. Thanks, acrylian.




How do I make uncropped (full proportion) thumbnails? - Bilder-Freak - 27-08-2008

Searched a long time for this - thanks!