SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Feb 2003
    Location
    Shropshire
    Posts
    203
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Advice on image resizing please

    I already have a script that uploads images and creates thumbnails (all stored on the server). What I now want is an image that is in between the main and thumbnail and I am not sure of the best way to do it.

    I did initially think it would be best to create these 'medium' images on the fly to save server space but after reading comments on here it seems like the wrong way to go about it.

    The medium sized image is shown on its own on a page as it is for an e-commerce site to sell prints where the first page displays all the thumbnails to click through to further information about the print (which is where I want the medium size image displayed). This image can then be clicked again to display the largest of the images.

    I don't want the largest of the images on the detail page as it would be too big.

    If creating them on the fly is the best option, does anyone know of a good tutorial on the best way to do this.

    Thanks

  2. #2
    SitePoint Wizard bronze trophy JRMillion's Avatar
    Join Date
    Apr 2004
    Location
    Arlington VA
    Posts
    2,094
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can do it on the fly... but it can be quite slow....
    if youre only loading one medium image it might be ok.
    but if you are creating a bunch of thumbs on the fly, it will be real slow.

  3. #3
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    Parry Sound, ON
    Posts
    725
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I recommend creating a script which will cache the created thumbnails. It checks the cache to see if one has already been created, and if so feed that out with readfile (after outputting appropriate Last-modified and Content-type headers). If not, then create it using GD or ImageMagick or whatever you use.

    I pass mine parameters like this:
    photo.php?i=983468.jpg&w=256&q=85

  4. #4
    SitePoint Evangelist pompopom's Avatar
    Join Date
    Feb 2004
    Location
    Huldenberg (Belgium)
    Posts
    426
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I allready did this once.

    I used the same code as for the thumbnail creation but I just changed the width and heigth values

    Uploaded (to hosting company over cable connection) arrays of more then 50 pictures at once and this took about 5 minutes, uploading and handling

    I can post you the complete code if you like? Used the GD libraries tough

    greetz,
    koen
    The Path of excess leeds to the tower of wisdom (W. Blake)


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
  •