Adding Photos To Website

Discussion in 'Web Design and Development' started by JackT06, Nov 28, 2009.

  1. JackT06 macrumors 6502


    Jul 24, 2009
    I am currently setting up my own photo website. Of course one thing which im going to need is to be able to put photos what i plan on doing is making little thumbnails but how do i do this at the moment i use this code
    <a href="" target="_blank">
    <img src="" width="100" height="131" border="0" alt="Photo of a big bunny rabbit!" />
    But the problem is that when i put that code onto my website the little thumbnail doesnt look right because of the pixels. Can anyone recommend a better way?
  2. NathanCH macrumors 65816


    Oct 5, 2007
    Stockholm, Sweden
    The code looks right. What do you mean "because of the pixels"? I'm guessing the problem is that resizing a large image via code is causing it to not only load slowly, but look bad too.

    What you should do is resize each image in photoshop first. Or you can use Automator and do a bunch of images at once.

    There is PHP code that can create thumbnails for you and auto post. But I think it may be too complex at this stage.
  3. JackT06 thread starter macrumors 6502


    Jul 24, 2009
    Ye its loading slow and also looking bad because all the pixels have been squashed together.

    Ye i will try and use Automator to resize a few and see what the output is.

    Ye im not to familiar with PHP
  4. Consultant macrumors G5


    Jun 27, 2007
    Remove height and width code if that produces an image that is not the right ratio.

    Also, you want to host the images on your own server. Photobucket will remove the images if too many hits / hot link.
  5. JackT06 thread starter macrumors 6502


    Jul 24, 2009
    Ye i put the images through atomater and then removed the height and width and its fine now thanks :D.

    Oh right, thanks for telling me i didnt know that. Gota find somewhere to host my site now :D
  6. SrWebDeveloper macrumors 68000


    Dec 7, 2007
    Alexandria, VA, USA
    Just thought I'd throw this in for good measure...

    If you find a webhost supporting PHP and GD graphics library, you can automate thumbnail creation by following the advice on this page:

    It includes instructions on GD, the PHP commands to the resize, and most importantly the proper formula to resize and maintain the aspect ratio of the image at the same time. For example, upload one or more images and process each image with a script that automatically creates the thumbnails for you as well as the gallery.



Share This Page