WordPress.org

Ready to get started?Download WordPress

Forums

How does WordPress 2.0.1 determines when to create a thumbnail? (16 posts)

  1. ktulaman
    Member
    Posted 8 years ago #

    By looking at inline-uploading.php, it seems to me that when the width of an image is more than 128 pixels, WP will call the function wp_create_thumbnail to create a thumbnail for the image. For some reason, sometimes, this is not working for me. I have an jpg image that is 800x600. WP does not seem to be able to determine the size of this file so no thumbnail is created. If i convert the same file to the png format, then WP will create thumbnail. What's going on?

  2. mylagoon
    Member
    Posted 8 years ago #

    I haven't experienced this, and have uploaded hundreds of photos for a client on their business website built using WP.

    What version of WP are you running? May I suggest that if you're not running the latest 'stable' release, WP2.0.1, that you upgrade and see if your problem persists.

    http://wordpress.org/latest.zip

  3. ktula
    Member
    Posted 8 years ago #

    I have the latest stable WP, 2.0.1. Looking at the code, WP is using the PHP function getimagesize to determine the size of the image. I wrote a simple script that basically does what inline-uploading.php does and i am able to verify that getimagesize is able to get the size of the "problematic" jpg file that i have been trying to upload. So i am not really sure why WP is able to convert the png version of the file but not the jpg version.

  4. mylagoon
    Member
    Posted 8 years ago #

    How are you verifying that WP has created the thumbnail?

    However by looking at your site, I'd say you have bigger problems than the thumbnail creation:

    "Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of xml_parser_set_option(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /usr/local/apache2/htdocs/ktula/wordpress/wp-content/plugins/now-reading.php on line 866

    Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of xml_set_object(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /usr/local/apache2/htdocs/ktula/wordpress/wp-content/plugins/now-reading.php on line 867"

    etc..

    You're layout is all broken too, I'm running Firefox 1.5.0.1

  5. ktula
    Member
    Posted 8 years ago #

    You must have been on my site when i turned on debugging in php.ini :)

    I was able to determine that no thumbnail was created when i tried to upload the jpg by looking at the uploads directory. Also, there is no option on the uploaded image itself to select either "using original" or "using thumbnail". When i click on the image for option, it said "no thumbnail".

  6. mylagoon
    Member
    Posted 8 years ago #

    Found this, pretty old, in the Trac:
    http://trac.wordpress.org/ticket/1952

    But perhaps you are having the same problem? The posible solution (cause of your problem) is obviously not correct, as your WP does generate thumbnails on certain images, but php.ini settings are worth looking into.

    Have you tried uploading a smaller jpg image and seeing if that works, or are all jpg files regardless of size not creating thumbnails?

  7. ktula
    Member
    Posted 8 years ago #

    I have tried uploading smaller jpg (smaller file size and also smaller resolution) but nothing works. jpg seems to be the only image format not work - png and gif are ok.

  8. Chris_K
    Member
    Posted 8 years ago #

    Say, looking at that trac ticket... what's "GD"? My server NEVER creates thumbnails either, and I wonder if that's not the issue.

  9. vkaryl
    Member
    Posted 8 years ago #

    GD is a graphics manipulation library sometimes installed by your host - and sometimes not.

    You can find out all this sort of wonderful stuff by copying the following into a text file:

    <?php
    phpinfo();
    ?>

    Save it as info.php, upload it to your root folder (usually something like /public_html/), and visit the file in your browser.

    Everything you didn't know you needed to know....

  10. Chris_K
    Member
    Posted 8 years ago #

    Oh, I'm well versed in phpinfo(). But if GD ain't installed (I own my server) then it sure won't show up there. And if I don't know what GD stands for, then I won't know what to get.

    And then I'll start bitching that the WP requirements don't mention anything with the intials of GD at all. And we sure don't want that, do we?

    So that's the proper name? "GD" Off to php land I go then to search for it.

  11. vkaryl
    Member
    Posted 8 years ago #

    GD is just GD. I've never known it by anything but that....

    From the first listing in google:

    GD Graphics Library
    GD is an open source code library for the dynamic creation of images by ... GD is written in C, and "wrappers" are available for Perl, PHP and other ...
    http://www.boutell.com/gd/ - 20k - Cached - Similar pages

  12. Chris_K
    Member
    Posted 8 years ago #

    Aye, I see it mentions that is included with PHP. Huh.
    Pity it don't do anything for me. Alas. Fortunately, I'm not a big-time picture blog!

    Something to futz with on a rainy day I suppose.

  13. vkaryl
    Member
    Posted 8 years ago #

    Do you have the latest version of php? I've been running XAMPP forever seems like, and it comes with it....

  14. Chris_K
    Member
    Posted 8 years ago #

    PHP 5.0.4

  15. vkaryl
    Member
    Posted 8 years ago #

    Huh.... well, not sure then....

  16. ktula
    Member
    Posted 8 years ago #

    Ok, that did it. I recompiled GD to make sure it included the jpeg library and after that, i recompiled php. WP is now able to create thumbnails for jpg.

    Thanks a lot for all your help!

Topic Closed

This topic has been closed to new replies.

About this Topic