Skip to content

Commit

Permalink
Fixed issue #17351: Also check that GD implement jpeg support (#1918)
Browse files Browse the repository at this point in the history
Co-authored-by: encuestabizdevgit <devgit@encuesta.biz>
  • Loading branch information
gabrieljenik and encuestabizdevgit committed Jun 14, 2021
1 parent b895897 commit ace6944
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion application/models/InstallerConfigForm.php
Expand Up @@ -113,6 +113,9 @@ class InstallerConfigForm extends CFormModel
/** @var bool */
public $isPhpGdPresent = false;

/** @var bool */
public $phpGdHasJpegSupport = false;

/** @var bool */
public $isPhpLdapPresent = false;

Expand Down Expand Up @@ -208,7 +211,9 @@ private function checkStatus()
$this->isSodiumPresent = function_exists('sodium_crypto_sign_open');

if (function_exists('gd_info')) {
$this->isPhpGdPresent = array_key_exists('FreeType Support', gd_info());
$gdInfo = gd_info();
$this->phpGdHasJpegSupport = !empty($gdInfo['JPEG Support']);
$this->isPhpGdPresent = true;
}
$this->isPhpVersionOK = version_compare(PHP_VERSION, self::MINIMUM_PHP_VERSION, '>=');
}
Expand Down
8 changes: 7 additions & 1 deletion application/views/installer/precheck_view.php
Expand Up @@ -112,7 +112,13 @@
<tr>
<td><?php eT("PHP GD library"); ?></td>
<td><span class='fa fa-check text-success'></span></td>
<td><?= $model->isPhpGdPresent ? $iconOk : $iconFail ?></td>
<td>
<?php if ($model->isPhpGdPresent): ?>
<?= $model->phpGdHasJpegSupport ? $iconOk : $iconFail . '<br/>' . gT("The GD extension found doesn't support JPEG") ?>
<?php else: ?>
<?= $iconFail ?>
<?php endif; ?>
</td>
</tr>
<tr>
<td><?php eT("PHP LDAP library"); ?></td>
Expand Down

0 comments on commit ace6944

Please sign in to comment.