Results 1 to 2 of 2

Thread: How to resize an image to fit in a desired space.

  1. #1
    Join Date
    Dec 2007
    Thanked 0 Times in 0 Posts

    Default How to resize an image to fit in a desired space.

    With this script you can upload images
    In the submit form you can provide
    the max height and max width needed.

    After submitting the uploaded image
    file will be resized to the new
    max height and max width provided.

    On the
    you can find the Example form
    you can also find the php code for the script.

  2. #2
    Join Date
    Mar 2006
    Illinois, USA
    Thanked 690 Times in 678 Posts


    This may help, as may other examples on the page:

    The question is how you want to deal with the width/height: Is the height the max? The width? Whichever is smaller? Larger? Doing some simple tests of $w>$h, etc will determine that, then you just need to decide what to do. Usually, it makes sense to find which is larger, then make the image that dimension at 100px (or whatever limit you choose), and have the other scaled smaller, relatively.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum


Posting Permissions

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