Results 1 to 13 of 13

Thread: PHP Image Gallery

  1. #1

    Thread Starter
    Lively Member DJ P@CkMaN's Avatar
    Join Date
    Jan 2002
    Location
    Burpengary, Queensland, Australia
    Posts
    95

    PHP Image Gallery

    hey all,
    does anyone know of any good image gallery scripts in PHP that DONT require anything extra installed on the server (ie. image magic)

    thanx
    There's something I've noticed in the last year or so...
    Australian's are good at EVERYTHING !!!

  2. #2
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    Really making your own is not hard to do. If you really want a script you will like its best to write it yourself so you can include features that you specifically want.

    If you are interested it doing it yourself read these:
    - Grabbing the image from the database:
    http://209.120.143.185/showthread.ph...ghlight=upload
    - Uploading the image:
    http://209.120.143.185/showthread.ph...ghlight=upload

    If you have any questions or need help, just ask.

    -Matt
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  3. #3
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    to make thumbnails you will need to use

    PHP Code:
    <?php
      $imageSize 
    getimagesize("projects/PHP/images/Banner Exchange.gif");
      
    $heightPercentage 370/$imageSize[0];
      
    $height $heightPercentage $imageSize[1];
    ?>
    <a href="projects/PHP/images/Banner Exchange.gif" target="_blank"><img 
    src="projects/PHP/images/Banner Exchange.gif" width="370px" height="<?php print "$height"?>
    border="0px" alt="Click to Enlarge"></a>
    What this does is I decided I wanted the width to be 370px and so I found out what percentage of the width it took to make the image 370 and then I applied that percentage to the height of the image so the distortion was not too terrible.

    You can decrease the width to whatever size you want but be sure to change both the <img> tag and the $heightPercentage formula (along with the image paths.

    -Matt
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  4. #4

    Thread Starter
    Lively Member DJ P@CkMaN's Avatar
    Join Date
    Jan 2002
    Location
    Burpengary, Queensland, Australia
    Posts
    95
    hey wow!! thaks HEAPS for the help the pics might be a fair bit distorted as the are screenshots coming form 1152x864 down to about 300x200 but i dont mind, thats great.

    thanks heaps!
    There's something I've noticed in the last year or so...
    Australian's are good at EVERYTHING !!!

  5. #5
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    Glad that helps.
    If you get stuck anywhere else just keep posting
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  6. #6
    Junior Member
    Join Date
    Jul 2002
    Location
    San Diego, CA, U.S.A
    Posts
    30
    another thing might be to use GD... most hosts have it installed....

  7. #7
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    What is GD and where can I read about it?
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  8. #8
    scoutt
    Guest
    the GD library? image creation

    it wouldn't help this guys, he already has the images.

  9. #9
    Addicted Member TheGoldenShogun's Avatar
    Join Date
    Mar 2001
    Location
    VA/MD... anywhere around the beltway
    Posts
    236
    hmm... that script that cpradio posted looks great. My only question is, does it kill the load time of the page? instead of loading, say a 96x96 image you're loading a 400x400 that is shrunken down to the height and width of a 96x96. Maybe I'm misunderstanding this but dont you load the enlarged image and then shrink it down to the size you specify. If I'm wrong, I'll definatley be using cpradio's script instead of creating and storing the image twice on the server using a Photoshop batch program. Take a look at what I mean...

    http://www.visualwow.com/pages/gallery.php?event=1214

    This is the demo gallery... we got the thumbnails (96x96) on the left side, you click on one and it brings up the enlarged file (400x400). Now I can save a lot of server space if I only need to make one image file, store it and shrink it down. That is, if the load time doesnt get killed because it has to load the enlarged images (I get calls about the site being slow from people on their 56K's all the time)

    Thanks
    [ On a side note, I think the site redesign for vbforums is just great. Simple, clean and effective. ]

  10. #10
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    Well, unfortunately you are right about it loading the larger image and just downsizing it.

    Most images I use that script for are never over 25k so its not a big deal for me however it can be if your images exceed that amount.

    Sorry.
    -Matt
    Last edited by cpradio; Jul 2nd, 2002 at 09:02 AM.
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  11. #11
    Junior Member
    Join Date
    Jul 2002
    Location
    San Diego, CA, U.S.A
    Posts
    30
    If I am correct... GD can manipulate already existing images... and resize them.. no server space will be taken, since it is made at run time

  12. #12
    scoutt
    Guest
    well yuou could use imagecopyesampled() but it doesn't say anything about an existing image. also need GD 2.0.1 and php4.0.6 for it to work.

  13. #13

    Thread Starter
    Lively Member DJ P@CkMaN's Avatar
    Join Date
    Jan 2002
    Location
    Burpengary, Queensland, Australia
    Posts
    95
    hmmm.. i thought of that but my host doesnt support it
    There's something I've noticed in the last year or so...
    Australian's are good at EVERYTHING !!!

Posting Permissions

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



Click Here to Expand Forum to Full Width