SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Feb 2007
    2 Post(s)
    0 Thread(s)

    Issue Of Tall Images Uploaded (Restrictions?)


    I have a DIV in which people can upload and display images. If the image is square or rectamgle the image is displayed fine. However if a user uploads a image which is very tall and very narror then the whole display of the site is messed up.

    Is it possible to prevent people from uploading images of a certain dimension. For example it cant be 25px wide by 100px height?

    Or is there another option I can use?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Melbourne, AU
    448 Post(s)
    8 Thread(s)
    Setting conditions like that would require a server-side script. With CSS, you can just determine how the uploaded content displays. You could, for example, set a min-width for the image (say 50% or 100% width of the container) and set a max-height to the container, and overflow: hidden to cut off some of the image.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."


Posting Permissions

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