The MU forums have moved to WordPress.org

Thumbnail on uploaded picture (7 posts)

  1. malandry
    Member
    Posted 16 years ago #

    Hi,

    Now, that's a issue I can't stand anymore... I've got so many support tickets open over it, it's just very annoying. I keep telling my users to upload it on imagedump script I've build on another domains but that would so much easier if they could do it properly in Wordpress.

    The problem is that ANY picture that is uploaded with the inline Wordpress editor is thumbnailed to a very small stretched pictures.

    What's the hack to avoid any thumbnailing?

    Thank you so much Wordpress :)

    Mathieu

  2. arma
    Member
    Posted 16 years ago #

    to change the default thumbnail size create a file called thumbnail.php and set the content to

    <?php
    /*
    Plugin Name: Change size of thumbnails
    Plugin URI: http://arma.us
    Description: Allows you to specify the size of thumbnails that wordpress automatically creates
    Version: 0.1
    Author: Alvin McDaniel
    Author URI: http://arma.us
    */

    function thumb_get_size($size) {
    return '222';
    }

    add_filter('wp_thumbnail_max_side_length','thumb_get_size');

    ?>

    return what ever size you want for the wp_thumbnail_max_side_length.

  3. arma
    Member
    Posted 16 years ago #

    Drop the plugin into the mu-plugins folder

  4. malandry
    Member
    Posted 16 years ago #

    Hi,

    It doesn't seem to work... maybe that's because I'm still using of those beta version of MU? But I would have to think it should work anyway.

    I figured out that you can use the original pictures by clicking on the «Thumbnail» link. It was about time, lol... Though it's not clear at all.

    Quick question : Why the $size parameter if you're not going to use it?

    Should I return "450"; or return 450; ?

    Thanks a lot.

    - Matt

  5. arma
    Member
    Posted 16 years ago #

    I am using it on v1.21 works great. You should return "450"; or '450';. It will create a thumbnail with the size parameter as the longest side.

  6. boonika
    Member
    Posted 15 years ago #

    Anyone knows how to modify this code for MU 2.5 or 2.6?

    Thanks

  7. musnake
    Member
    Posted 15 years ago #

    Hmm well there is a wp_create_thumbnail function in 2.6

    Shooting in the dark...

    function thumb_get_size($size) {
    return '450';
    }
    
    add_filter('wp_create_thumbnail','thumb_get_size');

About this Topic

  • Started 16 years ago by malandry
  • Latest reply from musnake