Posting images to wordpress

Discussion in 'WordPress' started by mrspeed, Nov 30, 2006.

  1. #1
    When posting images do you resize them before uploading or is there a way resize in Wordpress ? It's kind of a pain to do it before uploading the pic.

    I know you can "resize" in the visuual rich editor by dragging the handles but that only changes the height and width tags, it's not a true resize.

    My inline images need to be less than 400 pixels to not blow up the template.
     
    mrspeed, Nov 30, 2006 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    If you have GD enabled on your server, you can edit one of the wordpress files to resize them to a max of 400px. Otherwise i would definitely resize them before you upload them.
     
    jestep, Nov 30, 2006 IP
  3. mrspeed

    mrspeed Guest

    Messages:
    193
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I found a way to resize when uploading. I had to modify inline-uploading.php
    It works great and really speeds up posting.

    I found it here:
    http://www.silverjuke.net/forum/topic-635.html

    It goes something like this:


    #
    #-----[ OPEN ]------------------------------------------
    #
    wp-admin/inline-uploading.php

    #
    #-----[ FIND ]------------------------------------------
    #
    $imagedata['height'] = $imagesize['1'];

    #
    #-----[ AFTER, ADD ]------------------------------------------
    #
    //+MOD: Resize large images after upload
    $max_width = 400;
    $max_height = 400;
    if( $imagedata['width'] > $max_width || $imagedata['height'] > $max_height )
    {
    $temp = wp_create_thumbnail($file, $imagedata['width'] > $max_width? $max_width : $max_height);
    if ( @file_exists($temp) ) {
    unlink($file);
    rename($temp, $file);
    $imagesize = getimagesize($file);
    $imagedata['width'] = $imagesize['0'];
    $imagedata['height'] = $imagesize['1'];
    }
    }
    //-MOD: Resize large images after upload

    #
     
    mrspeed, Nov 30, 2006 IP
  4. Bondat

    Bondat Peon

    Messages:
    2,397
    Likes Received:
    217
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Do you host your blog or on wordpress.com?
     
    Bondat, Nov 30, 2006 IP
  5. Zeo

    Zeo Active Member

    Messages:
    158
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #5
    Ain't the uploaded image is resize to thumbnail size by default.
     
    Zeo, Nov 30, 2006 IP
  6. abdussamad

    abdussamad Active Member

    Messages:
    543
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Use the upload file option to add images and you can then create thumbnails etc.
     
    abdussamad, Dec 2, 2006 IP