General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 1st, 2004, 01:50 PM
JY11 JY11 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 8 JY11 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Resizing Images

I'm working on a website in PHP that allows users to upload images to a folder on the server. I was hoping someone could point me in the right direction as to how to create thumbnail images as well as using the thumbnails to display the original image. I'm not even sure where to start on this. I'm hoping someone can give me a link to some good articles on this subject or something like that. Not trying to get anyone to write it for me just looking for a place to start at. Thanks for the help.

Reply With Quote
  #2  
Old April 1st, 2004, 02:20 PM
littleblackdog littleblackdog is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Anchorage
Posts: 118 littleblackdog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
My workaround has been to force a stardard size on the image when it displayed. This is easy but can distort images that are odd sized.
The image can also then have a hyperlink attached that opens a temp page to display the image at full size.
This is what you are trying to do?
Good luck.
__________________
bow wow!

Reply With Quote
  #3  
Old April 1st, 2004, 02:51 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
There's at least one tutorial and probably a couple of threads about this here at this site. Look around for something about "GD" or "photo album." Essentially, if you want to create separate thumbnails to optimize page load and avoid image distortion that would arise from the workaround already mentioned, you'll need to look into using either PHP's image manipulation functions (try http://www.php.net/image_create as a starting point) or ImageMagick's apache module, which can perform image translations on the fly.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #4  
Old April 1st, 2004, 05:19 PM
Pheifel Pheifel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Denmark
Posts: 174 Pheifel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 46 sec
Reputation Power: 5
Send a message via MSN to Pheifel
a way to do it, without getting the nasty streach-marks on the pictures due to wierd size uploads, id to get the image sice, and then determin the scalin by the ralatyions of the height and width of the picture to create the variables that are the thumbnail-size. This is a rather big piece of work. but pays of.

Reply With Quote
  #5  
Old April 1st, 2004, 08:33 PM
crudesys crudesys is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: California
Posts: 25 crudesys User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
<IMG SRC="uploaded photo path" HEIGHT=YY WIDTH=XX>

this one just reduces the size of the image as it is displayed in the page. but this does not reduce the file size i.e 50K will still be 50K though it appears smaller. this is quite a disadvantage with load time.

Reply With Quote
  #6  
Old April 2nd, 2004, 02:34 AM
Pheifel Pheifel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Denmark
Posts: 174 Pheifel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 46 sec
Reputation Power: 5
Send a message via MSN to Pheifel
thats true. But then, you calculate the new thumbnailsizes, and then store a new image, with that size, in a thumbnail folder. then this picture will be bothe smaler in size, and in file-size.

Reply With Quote
  #7  
Old April 2nd, 2004, 11:10 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Quote:
Originally Posted by crudesys
<IMG SRC="uploaded photo path" HEIGHT=YY WIDTH=XX>
LOL!

A better solution would be to use a component such as PHP's GD object, or some other component that does on-the-fly image manipulation. I.e. see dhouston's post.
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #8  
Old April 2nd, 2004, 02:19 PM
crudesys crudesys is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: California
Posts: 25 crudesys User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
that's how i do it. i guess i need to do some reading. thanks

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Resizing Images


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT