SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

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

    Issue Of Tall Images Uploaded (Restrictions?)

    Hi,

    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
    Location
    Melbourne, AU
    Posts
    24,331
    Mentioned
    463 Post(s)
    Tagged
    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.


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
  •