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 July 22nd, 2003, 06:44 PM
hearn hearn is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: East Lansing, MI
Posts: 7 hearn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to hearn Send a message via AIM to hearn Send a message via Yahoo to hearn
GD Problems

I'm trying to create a scrip that will rotate pictures. The only time this works is when i rotate the first time to the right. Other then that it gets totally altered. here is the code, anyone have any ideas?

Thanks in advance!

PHP Code:
 $define explode(","$action);
        
        if (
$define[0]=="rotate") {
            if (
$define[1]=="right") {
                
$angle = -90;
            } else if (
$define[1]=="left") {
                
$angle 90;
            }

            
$src_img ImageCreateFromJPEG($path $current["id"] . "_" $current["title"] . "/temp/" $define[2]);
            
$original_x imagesx($src_img);
            
$original_y imagesy($src_img);
            
$new_x $original_y;
            
$new_y $original_x;
            
$src_img ImageRotate($src_img,$angle,0);
            
$dst_img imagecreatetruecolor($new_y,$new_x);            
            
imagecopyresampled($dst_img$src_img0000$new_x$new_y$original_x$original_y); 
            
imagejpeg($src_img$path $current["id"] . "_" $current["title"] . "/temp/" $define[2]);
            
Header("Location: $PHP_SELF?start=$start");
        } 

Reply With Quote
  #2  
Old July 23rd, 2003, 09:53 AM
crazytrain81 crazytrain81 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 232 crazytrain81 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Are you being sure to test this code with JPEGs only? May be a stupid question, but using GIFs or PNGs will definitely screw your images up.

Reply With Quote
  #3  
Old July 23rd, 2003, 11:01 AM
hearn hearn is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: East Lansing, MI
Posts: 7 hearn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to hearn Send a message via AIM to hearn Send a message via Yahoo to hearn
Yes, only jpegs.

Thanks though.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > GD Problems


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
Stay green...Green IT