From a7ead82d888b448626c5bde872208114cceaf5db Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 16 May 2008 14:23:54 +0200 Subject: prefer the upper part of portrait photos when cropping darcs-hash:20080516122354-7ad00-9da7f5011631ad40855d7becd1258a415f2e1f48.gz --- lib/exe/fetch.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/exe/fetch.php b/lib/exe/fetch.php index 1cf1c6e82..d0caffd46 100644 --- a/lib/exe/fetch.php +++ b/lib/exe/fetch.php @@ -224,6 +224,9 @@ function get_resized($file, $ext, $w, $h=0){ * Crops the given image to the wanted ratio, then calls get_resized to scale it * to the wanted size * + * Crops are centered horizontally but prefer the upper third of an vertical + * image because most pics are more interesting in that area (rule of thirds) + * * @author Andreas Gohr */ function get_cropped($file, $ext, $w, $h=0){ @@ -254,7 +257,7 @@ function get_cropped($file, $ext, $w, $h=0){ } // calculate crop offset $cx = (int) ($info[0]-$cw)/2; - $cy = (int) ($info[1]-$ch)/2; + $cy = (int) ($info[1]-$ch)/3; //cache $local = getCacheName($file,'.media.'.$cw.'x'.$ch.'.crop.'.$ext); -- cgit v1.2.3