• richmaster

    (@richmaster)


    Hello
    I just upgraded to 2.5 and am looking for a solution to a problem I’ve come across. When I upload an image I choose “full size” and then insert it into the post. The problem is that it doesn’t add the image full size.

    For example, I have my thumbnails set as default, medium pictures set at 300 width and 300 height. Then when I upload an 650 x 650 image and choose “full size” and insert it into a post the image is resized to 500 width.

    The image itself isn’t actually being resized, but rather scaled down with html.

    Anyone know how to resolve this?
    Thanks1

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter richmaster

    (@richmaster)

    Found the solution myself.

    Turns out WordPress rescales the image with html (like said above). The change it you need to edit wp-includes/media.php

    On line 34 look for $max_width = 500; and change the 500 to whatever you’d like. This should seriously be a setting in the dashboard.

    jaredh123

    (@jaredh123)

    yes, this is frustrating. is there a way for theme writers to have the theme pass their own max width to WP so that users don’t have to edit this file?

    thanks for any help.

    Clicknathan

    (@clicknathan)

    For theme writers, or anyone else who can edit their theme, try adding the following to your functions.php file:

    $content_width = 650; // pixels

    You’ll have to add that between some <?php> tags.

    Nathan Rice

    (@nathanrice)

    @clicknathan – can you link to the documentation of that? Where did you find it?

    jaredh123

    (@jaredh123)

    clicknathan,

    thanks, that worked. inserted

    <?php $content_width = 900 ?>

    into my theme’s function file.

    much appreciated.

    colombo79

    (@colombo79)

    yea, this should definitely be a dashboard function.

    also if i submit a full size image it still links to a new page with the exact same full size image…

    and finally media uploader should allow for preferred image format definition.

    technabob

    (@technabob)

    I tried this in the theme’s functions.php and it didn’t work. It only seems to work for me if I modify the wp-includes/media.php file — ugly.

    Any ideas?

    colombo79

    (@colombo79)

    technabob,

    the only ugly thing into it is that the width limitation shouldn’t be there in the first place, or being there it should be possible to change via dashboard… huge feature flaw.

    changed the media.php file and it worked fine.

    technabob

    (@technabob)

    I agree. I don’t think it should automatically add widths, because scaling images in HTML just plain sucks.

    vandiumsw

    (@vandiumsw)

    Just curious did you search on the forum before posting?

    This question was already answered shortly after 2.5 released: Same answer but with one added option.

    http://wordpress.org/support/topic/164667?replies=12

    logicalnot

    (@logicalnot)

    Hi
    I am using the Hemingway theme on WP 2.5.1. Unfortunaly, just pasting
    <?php $content_width = 900 ?>
    doesn’t work.

    I have this message coming up :
    Warning: Cannot modify header information - headers already sent by (output started at /mnt/MY_DATABSE_ADDRESS/wp-content/themes/MY_THEME/functions.php:3) in /mnt/MYDATABSEADDRESS/www/MY_WORDPRESS/pluggable.php on line 694

    logicalnot

    (@logicalnot)

    OK — never mind. I fix it.

    I just pasted
    $GLOBALS['content_width'] = 960;
    somewhere in the functions.php file and it now works.

    I have tried do as suggested, but adding:

    $content_width = 600;
    $GLOBALS['content_width'] = 600;

    to my functions.php file did not work.

    This is indeed an annoying bug, and still seems to exist in WP 2.5.1.

    I just discovered this and now have to go through all my images that have already been inserted into pages to get the correct size.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Image size’ is closed to new replies.