diff --git a/html/inc/profile.inc b/html/inc/profile.inc
index 8dd91b35f0d..fdbf4f74c7a 100644
--- a/html/inc/profile.inc
+++ b/html/inc/profile.inc
@@ -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);