Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-8364

Uploading photos of premiums gives a PHP GD error even when GD is installed and configured properly

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4
    • Fix Version/s: 3.4.5, 4.0.5
    • Component/s: CiviContribute
    • Labels:
      None

      Description

      When managing premiums at /civicrm/admin/contribute/managePremiums?reset=1, the upload feature doesn't actually work on my Debian server with php5 and php5-gd installed. It gives this error:

      NOTICE: No thumbnail of your image was created because the GD image library is not currently compiled in your PHP installation. Product is currently configured to use default thumbnail image. If you have a local thumbnail image you can upload it separately and input the thumbnail URL by editing this premium.

      But the GD library is installed and working:

      micah@debian:~$ cat gd.php
      <?php print_r(gd_info()); ?>
      micah@debian:~$ php gd.php
      Array
      (
      [GD Version] => 2.0
      [FreeType Support] => 1
      [FreeType Linkage] => with freetype
      [T1Lib Support] => 1
      [GIF Read Support] => 1
      [GIF Create Support] => 1
      [JPEG Support] => 1
      [PNG Support] => 1
      [WBMP Support] => 1
      [XPM Support] =>
      [XBM Support] =>
      [JIS-mapped Japanese Font Support] =>
      )

      It turns out that CiviCRM is checking for "JPG Support" instead of "JPEG Support", and also for some reason the check for "GIF Read Support" fails even though it's enabled. This patch removes several of the checks and instead only checks to make sure "GD Support" is enabled. The image upload and resizing works fine now with this patch.

        Attachments

          Activity

            People

            • Assignee:
              rajan Rajan P Mayekar
              Reporter:
              micah Micah Lee
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: