WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] max Width full size image (31 posts)

  1. ggsalas
    Member
    Posted 6 years ago #

    Hi, i want to change the width of the images at full size but I only have this option for Thumbnail size and Medium size. My problem is that reduces image 500px and I need a larger size. Thanks.

  2. Michael Torbert
    WordPress Virtuoso
    Posted 6 years ago #

    Edit the code. You'll see something that says:
    <img src="image.jpg" width="500px"> or something similar. Change the width to whatever you want.

  3. vandiumsw
    Member
    Posted 6 years ago #

    I am also looking for this answer.

    Obviously the code needs to edited, the real question is does anyone know which .php file contains the code to edit the "full" size image?

  4. Michael Torbert
    WordPress Virtuoso
    Posted 6 years ago #

    Be more specific. There isn't a php file in WordPress the "edits" a full size image.

  5. ggsalas
    Member
    Posted 6 years ago #

    http://picasaweb.google.es/ggsalas/COMPU/photo?authkey=aYDHbedNA0Y#5183941095212901522
    In this image you can see the options provided by wordpress 2.5, I can not place the maximum size of the full size images, but will automatically resizes to 500px

  6. vandiumsw
    Member
    Posted 6 years ago #

    I will try to be clearer.
    My main column width in my Kubrick styles.css is now 580px. Therefor the texts of my posts are 580px across. When I upload an image that is 580px WP 2.5 automatically resizes it to 500px--but only in the post. Like normal, if you click on the image form inside the post it will then open a page with the 580px image. Even though I am selecting "full size" in the new image post options, WP 2.5 will only display 500px. What I am trying to find is where in the WP 2.5 is the code that is limiting the "full size" image to only 500px. Any help would be great. It is awesome that 2.5 lets us now set the size of the thumbnail and medium size image so easily--it is just the full size that is the hangup now.

  7. Michael Torbert
    WordPress Virtuoso
    Posted 6 years ago #

    In wp-admin/includes/media.php is the only reference I see to "500".
    I wasn't aware that 2.5 would only allow images to be displayed at 500px height. I have only played with 2.5 on a test site. If you're not able to figure out what to edit in media.php let me know and I'll spend some more time on it.
    Also, a link to your site that shows an image bigger than 640x500 but only showing up as 640x500 would be helpful.

  8. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Huh... That is some odd code there, I admit...

    It does look like it allows the theme to specify its own maximum content width and then it will use that instead of the 500. You can do this in any theme by adding this line to functions.php:
    $GLOBALS['content_width'] = 800;

    Replace 800 with the maximum width you want to use.

  9. ggsalas
    Member
    Posted 6 years ago #

    Otto42, works perfect. Thank you.

  10. vandiumsw
    Member
    Posted 6 years ago #

    The $GlOBALS code took care of the sizing issue when viewing the post, however, when writing a post the "full" size image is still limited to 500px. Not the end of the world here, but because of this your never quite sure how the post is going to look until you post it. Is there a piece of code we can place somewhere that also changes the default of 500px in the writing window?

  11. Michael Torbert
    WordPress Virtuoso
    Posted 6 years ago #

    /wp-includes/media.php has:

    // we're inserting a full size image into the editor.  if it's a really big image we'll scale it down to fit reasonably
                    // within the editor itself, and within the theme's content width if it's known.  the user can resize it in the editor
                    // if they wish.
                    if ( !empty($GLOBALS['content_width']) ) {
                            $max_width = $GLOBALS['content_width'];
                    }
                    else
                            <strong>$max_width = 500;</strong>
  12. Michael Torbert
    WordPress Virtuoso
    Posted 6 years ago #

    Well I meant to have the $max_width=500; part in bold, but you get the idea.

  13. parisoto
    Member
    Posted 6 years ago #

    Instead of setting a size, you can make the information of size dissapear when you choose Full Size. It´s ridiculous when you say you want the full size image and they try to resize it.

    Go to /wp-includes/media.php on line 84 and comment that line (//)

    // any other type: use the real image and constrain it
    // list( $width, $height ) = image_constrain_size_for_editor( $meta['width'], $meta['height'], $size );

    This way instead of
    <img src="..." class="..." width="..." height="..." />
    you will get
    <img src="..." class="..." />

    =)

  14. garazy
    Member
    Posted 6 years ago #

    Hi Parisoto,

    Thanks for this it is crazy, my blog images are by default 600 - so I choose full and it makes it 500!

    I think this should be addressed in 2.5.1 if that is going to be released.

    Gary

  15. shiatostorm
    Member
    Posted 6 years ago #

    I'm another realising this is a bit pants...it never was an issue before so not entirely sure why that bit of code has been included but there you go. The rest of the new 2.5 stuff seems to work pretty well save this glitch...

    so, until a re-release looks like we're going to live with a hack for now :)

  16. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    The fix I posted above does work correctly if you use it.

    The reasoning behind this code is that people upload "full size" images, which these days are several megapixels in size. This usually breaks a theme and makes it go off screen quite a bit.

    So the idea is that themes themselves can specify the correct maximum width of the content area, and then the media uploader will force "full size" images to that given size.

    The Globals trick above should work. If it's not, please explain what exactly isn't working about it in greater detail. Note that "writing" the post may show the smaller image in the editing window, but viewing it will show it at the specified size.

  17. webmatters
    Member
    Posted 6 years ago #

    Thank you thank you thank you! I thought I was going mad. I run a photo blog and everything is 640px - I uploaded the graphic 4 times before looking for a solution. I edited the media.php file as suggested above and it worked perfectly.

  18. dadasign
    Member
    Posted 6 years ago #

    Hi Otto42!

    Thanks for the Hint with the extra Line in the function.php

    Works fine for me :-)

  19. koads
    Member
    Posted 6 years ago #

    I am also having problem with this...

    However, none of the proposed solutions has worked.

    Is there a tested plugin that corrects this serious flaw ?

    / K

  20. koads
    Member
    Posted 6 years ago #

    Damnit,

    I solved it.

    I should have realized that all posted images gets a width and a height tag added in the code. And adding the line to functions.php wouldn't change those old posts, only newer ones...

    So, thx Otto42 for the solution...

    /K

  21. alanholding
    Member
    Posted 6 years ago #

    Thanks for the $GLOBALS solution. Saved me jamming pencils in my eyeballs.

  22. dfunkydog
    Member
    Posted 6 years ago #

    Hi guys,

    Upgrading wordpress will overwite this file (media.php). How can I prevent this from happening? Other than remembering to edit said file after upgrade.

    Is there a way to add max size to options in Settings-->Miscellaneous?

  23. red88music
    Member
    Posted 6 years ago #

    I tried do as suggested, but adding:

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

    to my functions.php file did not work.

  24. webedmonton
    Member
    Posted 6 years ago #

    The global function didn't work for me.

    I was trying to post a photo that was 288px wide and it was showing up in the posts as 205px wide and the correct height so it was "squished". If I clicked on the photo and opened it in a new tab it showed the correct photo. If I looked at the code it showed the correct dimensions. If I moused over the photo and clicked on properties it said the photo was 205px. It took me some time to figure this one out.

    It seems WordPress automatically adds a "class="alignright" to the photo (when I want it aligned right) and in my style sheet that class was set to image: 50%. Since my text area is 410px it was adjusting the width of the photo to 50% or 205px. I removed that line and now my images work and are the correct width.

  25. Laurel.McConnell
    Member
    Posted 6 years ago #

    I've gone and done it now... usually I can follow directions properly and not totally kill my blog beyond repair, but when I attemped to add the above "$Global..." code to my functions.php file, I must have put it in the wrong place, because my blog is... um... broken?!

    http://www.laurelmcconnell.com/blog

    I am now seeing an error message when the page loads (also the same when I try to go to my wp-admin page), and you'll see that awesome mistake of mine is on the first line...:

    $GLOBALS['content_width'] = 650;
    Warning: Cannot modify header information - headers already sent by (output started at /home/laurmcc7/public_html/blog/wp-content/themes/black-minimalism-10/functions.php:395) in /home/laurmcc7/public_html/blog/wp-includes/pluggable.php on line 694

    I've just tried to upgrade the blog to the newest WordPress verion in hopes of replacing all the files (except wp-content), it will overrite my mistake and take care of itself, but apparently not.

    Any advice on what to do? Other than not EVER trying to do something by myself again...

  26. Laurel.McConnell
    Member
    Posted 6 years ago #

    Nevermind... I called a friend and after a bit of digging we figured out that there was as bad functions.php file in my themes folder...

  27. rskrodzki
    Member
    Posted 6 years ago #

    Forgive me for being dense but what function.php ? In the includes folder or the theme folder ?

  28. chaz7979
    Member
    Posted 6 years ago #

    I love some of these responses.

    The link in WP 2.5 should not say "full size" unless it plans on inserting the full size image....period. This is a big UI blunder.

  29. popac
    Member
    Posted 6 years ago #

    Thanks Otto42, working.

    I have 2.6 and have same problem...not love to change core files :(

  30. furiousphotographers
    Member
    Posted 5 years ago #

    I'm using 2.6 and still cannot figure out the solution. My goal is to create a theme that can be shared with others. Therefore, I want to be able to allow people (wedding photographers) to post nice big pictures!

    photography blog

    Right now, I have to delete the set width and height. Is there a way so that when I select full-size, I won't have this problem?

Topic Closed

This topic has been closed to new replies.

About this Topic