From ffe9fa69e7e2db21486497730e169a161d6a8a78 Mon Sep 17 00:00:00 2001 From: "Janus B. Kristensen" Date: Fri, 4 Mar 2005 10:35:32 +0000 Subject: [PATCH] Automatically detect >=GD2 svn path=/trunk/boinc/; revision=5564 --- checkin_notes | 5 ++++- html/inc/profile.inc | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index 0ff0b9cae7..4e478b9135 100755 --- a/checkin_notes +++ b/checkin_notes @@ -25515,10 +25515,13 @@ Janus 4 Mar 2005 project directory. In the future you won't have to manually patch the CVS to edit these pages - simply add stuff to these callback functions. + - Automatically detect image library to use with profiles + (from Christian Beer) /html/ inc/ - home.php + user.inc + profiles.inc user/ show_user.php home.php diff --git a/html/inc/profile.inc b/html/inc/profile.inc index 47048f954e..e59460b486 100644 --- a/html/inc/profile.inc +++ b/html/inc/profile.inc @@ -318,7 +318,9 @@ function scale_image($image, $origWidth, $origHeight, $targetWidth, $targetHeigh $destHeight = $origHeight; } -if (1) { +$gd_info = gd_info(); +$newGD = (strstr($gd_info["GD Version"], "2.0")!=""); +if ($newGD) { // If you are using a modern PHP/GD installation that does 'truecolor' images, this is what's needed. $newImage = ImageCreateTrueColor($destWidth, $destHeight); ImageCopyResampled($newImage, $image, 0, 0, 0, 0, $destWidth, $destHeight, $origWidth, $origHeight);