Fix (commented out) for getting images working on systems without GD2/PHP support.

svn path=/trunk/boinc/; revision=4549
This commit is contained in:
Bruce Allen 2004-11-14 02:17:44 +00:00
parent d3d3837169
commit 5a5a1eb67d
2 changed files with 9 additions and 1 deletions

View File

@ -19372,6 +19372,7 @@ Bruce Allen 13 Nov 2004
- Fixed, modified, tested script to remove workunits. Linked to main ops page.
- Fixed links at bottom of workunits page, showing outcomes of results.
- Added tabular description of tables to the database form page, longer clause box
- Added fix (commented out) to get pictures for systems without TrueColor support (GD v 2)
html/ops/
cancel_wu.php (removed)
cancel_wu_form.php
@ -19380,3 +19381,4 @@ Bruce Allen 13 Nov 2004
db_form.php
html/inc/
db_ops.inc
profile.inc

View File

@ -318,9 +318,15 @@ function scale_image($image, $origWidth, $origHeight, $targetWidth, $targetHeigh
$destHeight = $origHeight;
}
if (1) {
// 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);
} else {
// If not, use this block. The image quality is lower but it works using older PHP/GD versions.
$newImage = ImageCreate($destWidth, $destHeight);
ImageCopyResized($newImage, $image, 0, 0, 0, 0, $destWidth, $destHeight, $origWidth, $origHeight);
}
return $newImage;
}