ZenphotoCMS Forum
thumb cropping at max possible size - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: thumb cropping at max possible size (/thread-5432.html)



thumb cropping at max possible size - digitizer - 2009-07-04

hi there

when thumbnails are cropped they do not use the whole possible cropping area, which can be clearly seen by custom-cropping and getting more of the image inside the crop, which is what i would like.

how would i go about this?

thanks




thumb cropping at max possible size - sbillard - 2009-07-04

I assume you mean without doing a custom crop for each image--that is using some sort of default crop but with more of the image.

The crop works as follows:

The crop area of the image figured by comparing the with the crop size. So, for instance, if you have a thumb size set at 100 and a crop of 85x85, the crop will be 85% of the image. If you want a max sized crop, set the thumb size to the crop size.




thumb cropping at max possible size - digitizer - 2009-07-05

'I assume you mean without doing a custom crop for each image--that is using some sort of default crop but with more of the image.' - actually not with more, but with less of the image that it could.

i want the crops to be 247 x 180 and so had the thumb size set to 247.
playing around with the thumb size i noticed that at 100 it works the way i want but with obviously bad quality - its upscaled to be 247 x 180 in the gallery.

here is the options screen:
'http://www.superoforma.com/o.jpg'

thumb size of 100, uses max possible image area to generate thumb (good)
'http://www.superoforma.com/1.jpg'

thumb size of 247, doesnt use max possible image area to generate thumb (bad)
'http://www.superoforma.com/2.jpg'

same happens with 200, 246, 250 as with 247

hope its more clear now




thumb cropping at max possible size - sbillard - 2009-07-05

Since your thumbs are not square you will probably have to use the customthumb functions to get what you want. Please see the functions guide.




thumb cropping at max possible size - digitizer - 2009-07-05

any idea why it works at 100px and not at higher? they arent at all square at 100px stretched but function as expected

Edit: it actually works up to 180px the way it should. up to the crop height that is.. would you have any idea where this code as least is? the code that calculates this crop area




thumb cropping at max possible size - digitizer - 2009-07-06

ive found the cropping logic to be in the 'functions-image.php' file, either after '// Crop the image if requested' comment or abit up top, but can not seem to figure it out.

Someone, anyone? ive spent all day tryna fix it, when really it should take a few minutes )




thumb cropping at max possible size - sbillard - 2009-07-06

it is in functions-image.php in the cache image routine.




thumb cropping at max possible size - sbillard - 2009-07-06

But as I said earlier, you probably should be using the custom thumb functions.