Results 1 to 1 of 1

Thread: How to keep image ratio when it resizes?

  1. #1
    Mr.Bill's Avatar
    Mr.Bill is offline One is glad to be of service
    Join Date
    Dec 2008
    Location
    Redmond, Oregon
    Posts
    828
    Blog Entries
    1
    Thanks
    72
    Thanked 350 Times in 182 Posts

    How to keep image ratio when it resizes?

    I not sure what I should call it right now my design has something like this

    PHP Code:
    <a href="<?php the_permalink(); ?>"><img src="<?php viva(391,'');?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" align="top" style="border: 0px; padding: 0px; margin: 0px 0px 10px 0px; width: 391px;" /></a>
    So as you see any image added will stretch to 391 pixels not too bad of an issue but if the image is taller then wide then is messes up the layout.

    So I did something like this.

    PHP Code:
    <a href="<?php the_permalink(); ?>"><img src="<?php viva(391,'');?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" align="top" style="border: 0px; padding: 0px; margin: 0px 0px 10px 0px; width: 391px; max-height: 250px;" /></a>
    However if the image is taller then 250 pixels then it squashes the images which is an issue. Anyone now of a plugin that will auto resize a image or make them display correctly even if they are narrow will maybe add a background to fill in the black area?


    Well after searching guessing the easiest method is to resize all the images by hand
    Thumbnail (150 × 150) Medium (190 × 126)
    Large (375 × 249)
    Full Size (500 × 333)
    Last edited by Mr.Bill; 15 May, 2010 at 03:37 AM.

    Reverse IP Check ಠ_ಠ Proxy Sites
    <?php if ($youask == 'stupid question') { echo ('stupid answer'); } ?>

Similar Threads

  1. Post to Thread Ratio
    By .Razz in forum Community Building
    Replies: 16
    Last Post: 13 June, 2010, 15:02 PM
  2. Replies: 0
    Last Post: 27 October, 2009, 11:29 AM
  3. Thanks Post Ratio
    By GeeOne in forum Forum Life
    Replies: 5
    Last Post: 31 May, 2009, 17:18 PM
  4. Ratio of AdSense ads to content
    By keynes in forum AdSense
    Replies: 1
    Last Post: 11 April, 2009, 06:34 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •