Skip to content

Commit

Permalink
Merge pull request #5868 from BOINC/dpa_profile
Browse files Browse the repository at this point in the history
web: parse gd version number correctly
  • Loading branch information
AenBleidd authored Oct 30, 2024
2 parents 3e29eae + 60918aa commit fc7ecbf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions html/inc/profile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ function scale_image(
}

$gd_info = gd_info();
$newGD = (strstr($gd_info["GD Version"], "2.0")!="");
if ($newGD) {
$v = $gd_info["GD Version"];
$v = explode('.', $v);
$v = (int)$v[0]; // major version
if ($v >= 2) {
// If you are using a modern PHP/GD installation that does
// 'truecolor' images, this is what's needed.
$newImage = ImageCreateTrueColor($destWidth, $destHeight);
Expand Down

0 comments on commit fc7ecbf

Please sign in to comment.