View Full Version : copy image
when i have someone upload a picture how can i copy it and create a thumbnail?
Spookster
07-16-2002, 01:33 AM
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.
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.
exif_thumbnail($imageref) -- Basic Notes Here (http://www.php.net/manual/en/function.exif-thumbnail.php)
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 -
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.