• My theme has 750 pixels for the main content area (where the posts go). When I upload an image larger than 750, the width is resized to 750 but the height is not and it gets squished. The aspect ratio is no longer correct.

    To fix this I’ve been clicking on each image and clicking on the little image icon and then selecting 80% or 60% or whatever. This is inefficient because I can’t know what percentage to use so I have to guess and keep trying until it looks right.

    I’d like for my images to be resized automatically. Is this possible? I read about using a

    $GLOBALS['content_width'] = 700;

    I tried that but it didn’t have any effect.

    I’m using a lightbox plugin so once the user clicks on the image it’s shown full size, that’s fine. I’d just like the aspect ratio to be preserved on the page.

    Is it possible?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • When I upload an image larger than 750, the width is resized to 750
    but the height is not and it gets squished. The aspect ratio is no
    longer correct.

    – can you post a link where this is happening?

    I'd like for my images to be resized automatically. Is this possible?

    – Have you set your image dimensions at wp-admin/options-media.php? WP will automatically resize uploaded images to the ‘thumbnail’, ‘medium’, and ‘large’ sizes set on that page.

    Same problem here with wordpress 3.0. The thumbnails (featured image) keep the original height but squeeze the width of the image to fit the width of the post. Can someone help me to avoid thumbnail squeezing, i mean : scaling the image to the width of the post and keeping the original ratio for the height?

    thanks!

    The thumbnails (featured image) keep the original height but squeeze the width
    of the image to fit the width of the post.

    — featured images are usually handled outside the post content so I think it might be a similar, but different issue. can you post a link where this is happening?

    Got it … found the answer here : https://nenuno.co.uk/creative/wordpress/adding-post-thumbnails-to-wordpress-3-0/

    for me , only adding this line <?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) { the_post_thumbnail(array(200,160), array("class" => "alignleft post_thumbnail")); } ?>

    before the content in the loop solved the problem.

    Good luck!

    Thread Starter cunparis

    (@cunparis)

    jkovis – I can’t show it on my blog because I manually click on each image and put it at 60% to make it fit on the page.

    The media options you mention, I don’t want my images to be resized permantently. I just want them resized to fit on the web page. If I do what you say and then later change my theme the images will be sized to incorrect sizes.

    I found a plugin to do what I want. It’s called hungred image fit. It works great. I don’t have to resize anything now.

    https://www.ads-software.com/extend/plugins/hungred-image-fit/

    now if I can just get my images to be centered automatically it’d be perfect. It seems the uploader window doesn’t really center it even though i select “center”.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to avoid stretching large images in a post’ is closed to new replies.