PHP Thumb » Help & Bugs » Bugs

GD 2.0.34+ Compatibility Issue

(5 posts)
  1. Hi everyone,

    I start using PHP Thumb just couple weeks ago. Thanks for a such great utility component.

    After I have upgraged my WAMP to the newest version, I realized GD library in the WAMP has changed to 2.0.34. The GD version change results that GD Thumb Class Definition File Class will not be able to verify the JPEG mime type and store into format variable. Thus, the image processes are triggering errors. Below is the gd_info dump.

    GD Version : bundled (2.0.34 compatible)
    FreeType Support : 1
    FreeType Linkage : with freetype
    T1Lib Support :
    GIF Read Support : 1
    GIF Create Support : 1
    JPEG Support : 1
    PNG Support : 1
    WBMP Support : 1
    XPM Support :
    XBM Support : 1
    JIS-mapped Japanese Font Support :

    I put a quick fix for my code since the deadline is approching. I changed all the JPG to JPEG in GDThumb.inc.php. However, this fix is totally depending on the GD version on the server. If your PHP Thumb is running fine, you don't need to change it.

    Posted 2 years ago #
  2. After some research, I found that my couple clients hosting server are have GD 2.0.34, but they have JPG instead of JPEG. This may be the OS dependence issue. If anyone has a windows OS hosting server, please use the following code to dump the GD info and see it is JPG or JPEG.

    <?php
    $tmp = gd_info();
    echo '<table>';
    foreach($tmp as $key=>$value) {
    echo '<tr>';
    echo '<td>' . $key . '</td>';
    echo '<td>' . $value . '</td>';
    echo '</tr>';
    }
    echo '</table>';
    ?>

    The "JPEG Support" might only happen in Windows Vista.

    Posted 2 years ago #
  3. I think I found myself the answer. PHP 5.3.x will have JPEG instead of JPG. I tried PHP 5.2.8 which is on most of my clients' hosting servers and got JPG from gd_info. Now the problem is solved.

    If you have a server or have installed the server with PHP 5.3.x, you may need to change the GD Thumb Class Definition File Class in order to make the PHP Thumb function properly.

    Posted 2 years ago #
  4. Awesome, glad you caught that!

    I'll try and get a fix in for that in the near future so it won't break on 5.3

    Posted 2 years ago #
  5. I think I got a fix for this, which was added in the latest version released today. Hopefully that addresses the issue :)

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.