SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Zealot javierccs's Avatar
    Join Date
    Feb 2005
    Location
    Venezuela
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Showing picture

    hello friends,


    i have a table that i use to show a picture uploaded by the user, the only problem is that there are users that upload big picture and users that upload tiny ones, i want to stadarize the pictures shown, how can i do that?

    here's the code im using to show the picture
    HTML Code:
    <td><table border="0" cellpadding="0" cellspacing="0"><td><IMG src="<? echo $dest;?>"  align="right" border="0"></td></table></td>
    ...run Forrest....run!!

  2. #2
    Tranceoholic lilleman's Avatar
    Join Date
    Feb 2004
    Location
    Írebro, Sweden
    Posts
    2,716
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    You can set the height and width of the image like this:

    HTML Code:
    <img src="<? echo $dest;?>" width="100" height="50" align="right" border="0">
    Is this what you're looking for, or have I misunderstood the question?
    ERIK RIKLUND :: Yes, I've been gone quite a while.

  3. #3
    SitePoint Zealot javierccs's Avatar
    Join Date
    Feb 2005
    Location
    Venezuela
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi,

    you understood me well, i tried doing that before but it shrinks the pictures and they seems deformed , i have another table of data at the right side...

    ...run Forrest....run!!

  4. #4
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use PHP to resize them. I'll move this to the PHP forum
    Mike
    It's not who I am underneath, but what I do that defines me.

  5. #5
    SitePoint Zealot javierccs's Avatar
    Join Date
    Feb 2005
    Location
    Venezuela
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well since you move the forum, now the questions has changed...

    how do i resize the picture on php?,
    ...run Forrest....run!!

  6. #6
    get into it! bigduke's Avatar
    Join Date
    May 2004
    Location
    Australia
    Posts
    847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    with a little extra logic and by using the gd functions you can do that with php anyday. kindly read the manual for a ref on these functions

  7. #7
    SitePoint Evangelist -Oz-'s Avatar
    Join Date
    Nov 2001
    Location
    Phoenix, AZ, USA
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    do you have gd on you computer. If you do you can use the imagecopy functions
    Oz
    GamersMark - On Target Gaming
    OzTheory - Programming and Web Solutions
    AmIBlocked - Check if you've been blocked on IM

  8. #8
    SitePoint Zealot javierccs's Avatar
    Join Date
    Feb 2005
    Location
    Venezuela
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi,

    ty for responding, i store the image in a folder with a form, but im not really sure how to use the function you are saying, all the photos are saved with the same name (userphoto.jpg)

    there are users that saved little photos and users that saved really big ones, right now its working free (without any restrictions) and photos are being displayed as they are....

    so i guess the funtion must resize the photos in order to show them (big ones and little ones) in the same area.
    ...run Forrest....run!!

  9. #9
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,788
    Mentioned
    151 Post(s)
    Tagged
    3 Thread(s)
    You need to check if you have GD installed on your server. You can find it on phpinfo()
    If you have that, you can resize images on the fly.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  10. #10
    get into it! bigduke's Avatar
    Join Date
    May 2004
    Location
    Australia
    Posts
    847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    there's lots of code out there to resize images mate ...


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
  •