Automatically detect >=GD2

svn path=/trunk/boinc/; revision=5564
This commit is contained in:
Janus B. Kristensen 2005-03-04 10:35:32 +00:00
parent a910b038c6
commit ffe9fa69e7
2 changed files with 7 additions and 2 deletions

View File

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

View File

@ -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);