Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: copy image

  1. #1
    Registered User
    Join Date
    Jun 2002
    Location
    Arizona
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts

    copy image

    when i have someone upload a picture how can i copy it and create a thumbnail?

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    What do you mean by copy it? As for creating thumbnail size images from them that would be easy. Do you know what graphic modules your host has installed with php? ie. php gd library and there is another popular one that I can't think of off the top of my head.... imagemagik or something like that maybe.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Registered User
    Join Date
    Jun 2002
    Location
    Arizona
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i have gd i believe. but isn't there a imagecopy() function or something?

    what i want to do is have the image upload, be placed in a directory then have a thumbnail put in another directory. so when you view the image archive i can have thumbnial load instead of the full blown image.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    exif_thumbnail($imageref) -- Basic Notes Here

    I much prefer the GD libraries way as you have hoops more
    control over the output size and other parameters - you can
    also add a bit of shading to the edges for a 3D effect, overwrite
    your site logo on them, trim the edges - etc etc.

    Assuming you have some sort of administrator 'accept/decline
    new uploads' facility - all you'd need to do is, upon acceptance -
    rename the uploaded image (thus moving it to the proper folder)
    and echo back to the admin page an image tag calling the auto
    thumbnailing script - eg
    <img src="thumb0.php?imgref=newim.jpg&width=120">
    then just compose thumb0.php to build and create a thumbnail
    based upon the imgref and width - or whatever.

    I'm writing a few scripts like that at the moment for a gallery
    backend distro type thing. If you let me know what GD version
    you have compiled and how you want the thumbnails styled, I
    could paste a lil scrippy -
    Ökii - formerly pootergeist
    teckis - take your time and it'll save you time.


  •  

    Posting Permissions

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