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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 26th, 2003, 12:57 PM
jben.net jben.net is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 51 jben.net User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 41 sec
Reputation Power: 6
Send a message via AIM to jben.net
cropping as well as resizing images using GD

Hi,

I'm currently resizing images using GD (with ratio etc) for thumbnails but I;d like to try just croping them instead, is this possible ??

Thanks,

Jon

Reply With Quote
  #2  
Old June 27th, 2003, 07:14 AM
devilFish devilFish is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 11 devilFish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have never heard of a function for cropping images, although it shouldnt be too hard to make one.

Reply With Quote
  #3  
Old June 28th, 2003, 04:09 AM
jben.net jben.net is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 51 jben.net User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 41 sec
Reputation Power: 6
Send a message via AIM to jben.net
got it, you just make an image with the sizes you want

PHP Code:
 $imgOrigWidth 500;
$imgOrigHeight 300;

$thumbImgWidth 40;
$thumbImgWidth 40;

$thumbImgResized Imagecreatetruecolor($thumbImgWidth$thumbImgHeight);

imagecopyresized($thumbImgResizedImageCreateFromJpeg($_FILES['strFile']['tmp_name']), 0, ($imgOrigWidth/2), ($imgOrigHeight/2), $imgOrigWidth$imgOrigHeight);

ImageJPEG($thumbImgResized$thumbImageStored);            
ImageDestroy($thumbImgResized); 


Jon

Reply With Quote
  #4  
Old June 30th, 2003, 02:28 PM
neoxean neoxean is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 5 neoxean User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cool... I didn think you could crop images either

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > cropping as well as resizing images using GD


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 6 hosted by Hostway