Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 07-10-2006, 11:02 AM thumbnails
Experienced Talker

Posts: 41
Trades: 0
have no idea how to deal with thumbnails.. i have seen a lot of tutorials but is like none of them make sense at all..is there any place where i can find a nice detialed tutorial on how to make thumbnails of pictures that are already in a directory..or when they are been uploaded to the site.. and how to out put them becuase i t ried to use the code in the same page and it show all the page source code..
richard181 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-10-2006, 11:42 AM Re: thumbnails
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
Trades: 0
What platform are you using?

Ibbo
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Linux user #349545 :
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCf
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Old 07-10-2006, 01:36 PM Re: thumbnails
Experienced Talker

Posts: 41
Trades: 0
i use windows i'm with yahoo.. i just dont know how to do thumbnails with php i want a detialed tutorials.. cuz i'm new so i can just look at a code and breake it down..

Last edited by richard181; 07-10-2006 at 02:00 PM..
richard181 is offline
Reply With Quote
View Public Profile
 
Old 07-11-2006, 06:31 AM Re: thumbnails
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
1. Read php manual on how to manage file uploads
2. Upload image
3. Resize it with imagemagick's mogrify or convert (they are supported by most *x servers) by calling the program through exec().
What can be simplier?
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 07-11-2006, 06:34 AM Re: thumbnails
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
E.g. exec("convert $_FILES['userfile']['tmp_name'] -scale $width -format jpg $path_to_thumbnail") will resize the uploaded image to $width pixels wide, convert it to jpg and write to $path_to_thumbnail file.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 07-11-2006, 07:11 AM Re: thumbnails
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
Trades: 0
Heres my ImageMagik method

PHP Code:
list($width$height$type$attr) = getimagesize($name);
        
$height $width ?
        
exec("/usr/bin/convert -size 150x200  {$name}  -thumbnail 75x100 $filename")
        :
        
exec("/usr/bin/convert -size 220x80  {$name}  -thumbnail 110x40 $filename"); 
I prefer ImageMagik (but dont know what kind of support it has on windows) for it is much more flexible and has much more stuff I can use to make better images.

GD is available if you dont have Imagemagik

http://icant.co.uk/articles/phpthumbnails/
http://www.sitepoint.com/article/php-gd-libraries

Those are just two samples of many many many php-gd tutorials using the search php GD thumbnails.

Ibbo
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Linux user #349545 :
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCf
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Old 07-11-2006, 07:32 AM Re: thumbnails
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Imagick has quite the same support on windows as on *x
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to thumbnails
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24575 seconds with 12 queries