summaryrefslogtreecommitdiff
path: root/lib/exe/fetch.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2008-05-16 14:23:54 +0200
committerAndreas Gohr <andi@splitbrain.org>2008-05-16 14:23:54 +0200
commita7ead82d888b448626c5bde872208114cceaf5db (patch)
treec0c065c4e2595d69c039886df686211618739c4a /lib/exe/fetch.php
parent681eb61bcd5b6b643474e7d064308956ef207f35 (diff)
downloadrpg-a7ead82d888b448626c5bde872208114cceaf5db.tar.gz
rpg-a7ead82d888b448626c5bde872208114cceaf5db.tar.bz2
prefer the upper part of portrait photos when cropping
darcs-hash:20080516122354-7ad00-9da7f5011631ad40855d7becd1258a415f2e1f48.gz
Diffstat (limited to 'lib/exe/fetch.php')
-rw-r--r--lib/exe/fetch.php5
1 files changed, 4 insertions, 1 deletions
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 <andi@splitbrain.org>
*/
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);