SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Guru davedibiase's Avatar
    Join Date
    Aug 2001
    Location
    Toronto, Canada
    Posts
    829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbnail maker!

    I'm working on an open-source project (a small portal system) that my clients can use for their websites. One of the modules that are included in the project is a photo gallery. I want to try and implement thumbnails but finding a good way to do is has been a hastle. I read a few tutorials on the net and they all have their own requirements and jargon.

    Does anyone have any easy and effective ways of sizing and displaying thumbnails on a website (not output them to the server) simply display them.

    Im hoping that the solution wont involve editing anything in particular. Since this will be released to beginner/intermediate developers I want it to be as easy for them to setup as possible.
    ||Dave Di Biase||
    ----------------------------------
    "There are 2 secrets in life. 1) Never say everything you know."
    GFXWARS - The ultimate graphics battle!

  2. #2
    pie??? PIE!!!! rsdl's Avatar
    Join Date
    May 2001
    Location
    Vancouver, BC Canada
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can set the width and height of the image via HTML, although the image size would remain the same. The only way i see displaying thumbnails efficiently is through the use of the GD library (i.e. create another smaller (dimension and file size-wise) image through php and GD.)

    -rsdl

  3. #3
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You'll proberly first in order of importance as I see it:

    1) Able to read a directory for image extension(s) ie .jpg and .png
    2) Read in these files, re-size them via GD - not a difficult task, honest
    3) As it's a gallery, you'll need to format a TABLE (HTML) to structure cells as 'containers' for each IMG.
    3.1) You'll also need to have 'paged links' to link to further images if the amount of images from the directory in question exceeds the defined amount to show per page, if you follow ?
    3.1.1) Do a search here at the PHP forums for some script on this, as it's a popular forum thread
    4) Be able to click on the thumbnail to provide a full size - or larger - image, again this isn't difficult - you could open a new window, resized to the size of the image for example ?
    5) An admin area whereby you can allow your clients to upload their images - this in it's self is a smaller project
    Have you looked at hotscripts.com ? This site btw was down the other day when I visited

    Hope this helps, if you've any questions etc then come back again.

  4. #4
    SitePoint Guru davedibiase's Avatar
    Join Date
    Aug 2001
    Location
    Toronto, Canada
    Posts
    829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeh I know what Im going to do [img]images/smilies/tongue.gif[/img]. Its a bit more complex because the gallery has to intergrate with two other project modules.

    How exactly would I add the GD extensions to the project?

    I keep on getting cant find extensions.
    ||Dave Di Biase||
    ----------------------------------
    "There are 2 secrets in life. 1) Never say everything you know."
    GFXWARS - The ultimate graphics battle!

  5. #5
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok

    The GD extension isn't installed by default, so you need to download it first.

    Then you un-comment the following from your php.ini file:

    PHP Code:
    .
    .
    ;
    extension=php_fdf.dll
    ;extension=php_filepro.dll
     
    # remove ; to uncomment
    extension=php_gd.dll

    ;extension=php_gettext.dll
    ;extension=php_hyperwave.dll
    ;extension=php_iconv.dll
    .

    Also note if you are using PHP4.3.x you're better off with GD2.0, else use GD1.8 or better for PHP2.3.x for example.

    Where you can download the actual extension, I can't remember.

    Sorry... maybe search php.net using 'GD library' might turn up a link, or look over the GD functions PHP has over there...

    ... there might be a link there ? Hope this helps...

  6. #6
    SitePoint Guru davedibiase's Avatar
    Join Date
    Aug 2001
    Location
    Toronto, Canada
    Posts
    829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I read all about setting it up and installing it just now (even how to do the thumbnails). Now my biggest problem is how exactly am I going to package this with my module? I was thinking:

    - going to provide the extension in the module file
    - within each script that uses the module I was going to use dl("php_gd.dll") and ini_set("extension_dir","") to assign that info. Just to make it easier for the person.

    I have to make this easy for every type of developer to use on any platform.

    What do you think?
    ||Dave Di Biase||
    ----------------------------------
    "There are 2 secrets in life. 1) Never say everything you know."
    GFXWARS - The ultimate graphics battle!

  7. #7
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ummm..... never used an extension this way.

    If it was me, I'd keep the module on my server, and either using PHP/Javascript give your client a Javascript link to place on their webpage.

    This would then pull the module from your server to their web page.... including any user interaction (ie FORM based) which again would execute from your module on your server.

    Untested though you could use a web service for this also. It's not the answer your looking for I know...


  8. #8
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can only set extension_dir in the php.ini or httpd.conf (if you're running Apache). If the GD file is in the extension_dir you can use dl() as long as it's not disallowed, e.g. through disable_functions or safe mode is on

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  9. #9
    SitePoint Guru davedibiase's Avatar
    Join Date
    Aug 2001
    Location
    Toronto, Canada
    Posts
    829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmm. Well then the only other option is to provide full documentation on setting it up properly.

    On another note I found some info on GD.

    Heres some php.net info on it: http://www.php.net/manual/en/ref.image.php
    and here is the link to downloading it: http://www.boutell.com/gd/
    ||Dave Di Biase||
    ----------------------------------
    "There are 2 secrets in life. 1) Never say everything you know."
    GFXWARS - The ultimate graphics battle!

  10. #10
    SitePoint Guru davedibiase's Avatar
    Join Date
    Aug 2001
    Location
    Toronto, Canada
    Posts
    829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anybody know of a GD binary that I can find? I finally got home and found that these are just sources -_-
    ||Dave Di Biase||
    ----------------------------------
    "There are 2 secrets in life. 1) Never say everything you know."
    GFXWARS - The ultimate graphics battle!

  11. #11
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For which platform? Windows/Linux/etc.

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  12. #12
    SitePoint Guru davedibiase's Avatar
    Join Date
    Aug 2001
    Location
    Toronto, Canada
    Posts
    829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well to be honest I would need all of them (for my own reasons).
    ||Dave Di Biase||
    ----------------------------------
    "There are 2 secrets in life. 1) Never say everything you know."
    GFXWARS - The ultimate graphics battle!


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
  •