Flip an Image - testmy.net resource / tool
Home
Welcome, Guest. Please login or register.
Did you miss your activation email?

 



donations help testmy.net pay for the very high cost to run the site. Any amount is greatly appreciated.
Click to read why...

  spcr
    
News : Have an idea that will make testmy.net better?  Click here to post it!  We love to hear feedback, user feedback like yours have helped build testmy.net over the years.. true story wink October 15, 2008, 08:45:23 PM
testmy.net Broadband  |  Main Forum  |  HELP!  |  Programming and Website Help  |  Topic: Flip an Image Advanced search
  0 Members and 1 Guest are viewing this topic. « previous next »
Pages 1 2  All Go Down
Author
Topic: Flip an Image  (Read 5983 times)
dlewis23
Global Moderator
TMN Seasoned Veteran
*
Online Online

Gender: Male
Posts: 9693


HEY! ill put it down when im good and ready.


View Profile
« on: September 19, 2006, 02:44:29 PM »

Im looking for some code that will flip an image virtucaly. ive looked all over and have found nothing.

i am trying to do something like the attached picture
Logged

Aggr3
Global Moderator
Expert
*
Offline Offline

Gender: Male
Posts: 1291


I'm a victim of my own making...


View Profile
« Reply #1 on: September 19, 2006, 02:59:35 PM »

try mirror image....then rotate 180 degrees..
 ;)
Logged

Thank God for Dway.....without them I wouldn't have Gray hair, High Blood pressure, or Califlower ear.......
DW6000 satmex5 1230MHz SS86
dlewis23
Global Moderator
TMN Seasoned Veteran
*
Online Online

Gender: Male
Posts: 9693


HEY! ill put it down when im good and ready.


View Profile
« Reply #2 on: September 19, 2006, 03:06:42 PM »

try mirror image....then rotate 180 degrees..
 ;)

even that way im still stuck because i still need code that will rotate a image. Im not just doing this for 1 image its for 1000's so i need it to do it dynamically with just code.
Logged

tommie gorman
Sophist Member
TMN Seasoned Veteran
*
Offline Offline

Gender: Male
Posts: 9988


"OLD GLORY"


View Profile
« Reply #3 on: September 19, 2006, 05:51:05 PM »

Just turn the monitor upside down.  ;)
Logged

IF YOU DON'T STAND BEHIND OUR TROOPS, PLEASE, FEEL FREE TO STAND IN FRONT OF THEM !!!

"an old country hick from america"

Sprint EVDO Rev. A * AMD 64 3500+ 2.2 GHz cpu Ram 2GB/XP Home * TCP Optimizer
Aggr3
Global Moderator
Expert
*
Offline Offline

Gender: Male
Posts: 1291


I'm a victim of my own making...


View Profile
« Reply #4 on: September 19, 2006, 05:53:54 PM »

try this..... nono thefinger

sorry couldn't resist....lol   :haha:
Logged

Thank God for Dway.....without them I wouldn't have Gray hair, High Blood pressure, or Califlower ear.......
DW6000 satmex5 1230MHz SS86
dlewis23
Global Moderator
TMN Seasoned Veteran
*
Online Online

Gender: Male
Posts: 9693


HEY! ill put it down when im good and ready.


View Profile
« Reply #5 on: September 19, 2006, 06:09:10 PM »

Just turn the monitor upside down.  ;)

i dont think that will work  :haha: :haha:
Logged

waterRTBH
TMN's Social Conscience
Global Moderator
TMN Veteran
*
Offline Offline

Gender: Female
Posts: 1994


I'm not a shoulder to cry on, but I digress


View Profile WWW
« Reply #6 on: September 19, 2006, 06:21:14 PM »

i dont think that will work  :haha: :haha:

What kind of code do you wish to do this with?  It may be possible with php and the gd library.  Also, Photoshop has a 'batch' command that could be used to automate this as well if you wants an easier way out?

Yes? no?
Logged


To lead people, walk beside them... As for the best leaders, the people do not notice their existence. The next best, the people honor and praise. The next, the people fear; and the next, the people hate... When the best leader's work is done the people say, 'We did it ourselves!' ~Lao Tzu
dlewis23
Global Moderator
TMN Seasoned Veteran
*
Online Online

Gender: Male
Posts: 9693


HEY! ill put it down when im good and ready.


View Profile
« Reply #7 on: September 19, 2006, 06:24:47 PM »

What kind of code do you wish to do this with?  It may be possible with php and the gd library.  Also, Photoshop has a 'batch' command that could be used to automate this as well if you wants an easier way out?

Yes? no?

no it has to be done server side, when the user requests the file, this is for all the users files that are uploaded now, and in the future.
Logged

waterRTBH
TMN's Social Conscience
Global Moderator
TMN Veteran
*
Offline Offline

Gender: Female
Posts: 1994


I'm not a shoulder to cry on, but I digress


View Profile WWW
« Reply #8 on: September 20, 2006, 04:45:59 AM »

OK

This is in PHP:

// File and rotation
$filename = 'test.jpg';
$degrees = 180;

// Content type
header('Content-type: image/jpeg');

// Load
$source = imagecreatefromjpeg($filename);

// Rotate
$rotate = imagerotate($source, $degrees, 0);

// Output
imagejpeg($rotate);


Good luck, hope it works.
Logged


To lead people, walk beside them... As for the best leaders, the people do not notice their existence. The next best, the people honor and praise. The next, the people fear; and the next, the people hate... When the best leader's work is done the people say, 'We did it ourselves!' ~Lao Tzu
dlewis23
Global Moderator
TMN Seasoned Veteran
*
Online Online

Gender: Male
Posts: 9693


HEY! ill put it down when im good and ready.


View Profile
« Reply #9 on: September 20, 2006, 07:33:51 AM »

that didnt work water, im just going to have to write it out my self in some javascript. thanks for your help tho.
Logged

disturbed
News Anchor
TMN Veteran
*
Offline Offline

Posts: 2097


I am and always will be disturbed.


View Profile
« Reply #10 on: September 20, 2006, 08:25:15 AM »

http://cow.neondragon.net/stuff/reflection/


This site has everything you need for this particular function - its a java script
Logged

Are you down with the sickness !?

[ http://hackaday.com ]
dlewis23
Global Moderator
TMN Seasoned Veteran
*
Online Online

Gender: Male
Posts: 9693


HEY! ill put it down when im good and ready.


View Profile
« Reply #11 on: September 20, 2006, 08:27:14 AM »

http://cow.neondragon.net/stuff/reflection/


This site has everything you need for this particular function - its a java script

thank you so much, thats exactly what i want.
Logged

disturbed
News Anchor
TMN Veteran
*
Offline Offline

Posts: 2097


I am and always will be disturbed.


View Profile
« Reply #12 on: September 20, 2006, 08:29:58 AM »

u got it  ;)
Logged

Are you down with the sickness !?

[ http://hackaday.com ]
waterRTBH
TMN's Social Conscience
Global Moderator
TMN Veteran
*
Offline Offline

Gender: Female
Posts: 1994


I'm not a shoulder to cry on, but I digress


View Profile WWW
« Reply #13 on: September 20, 2006, 04:56:20 PM »

Javascript will work for client end image flipping; however, if you want to have this take place at the server end you'll need to use some form of cgi, such as perl or php.  The code posted above definitely will work for this purpose, as long as your server host allows you to use php and supports the standard GD library (this is pretty standard, so they should).  As a proof of concept, I setup a test script with the following code:

You can see the before picture at: http://www.secondshifters.com/images/WaterRTBH.jpg
and the after picture at http://www.secondshifters.com/test.php

If you'd like to post or email the code in that you're using for your site, I should be able to integrate this in relatively easily for you if you still want a server end solution to this.
Logged


To lead people, walk beside them... As for the best leaders, the people do not notice their existence. The next best, the people honor and praise. The next, the people fear; and the next, the people hate... When the best leader's work is done the people say, 'We did it ourselves!' ~Lao Tzu
waterRTBH
TMN's Social Conscience
Global Moderator
TMN Veteran
*
Offline Offline

Gender: Female
Posts: 1994


I'm not a shoulder to cry on, but I digress


View Profile WWW
« Reply #14 on: September 20, 2006, 05:00:44 PM »

Whooops! Forgot the code. dangit!

<?php

// File and rotation
$filename = 'images/WaterRTBH.jpg';
$degrees = 180;

// Content type
header('Content-type: image/jpeg');

// Load
$source = imagecreatefromjpeg($filename);

// Rotate
$rotate = imagerotate($source, $degrees, 0);

// Output
imagejpeg($rotate);


?>
Logged


To lead people, walk beside them... As for the best leaders, the people do not notice their existence. The next best, the people honor and praise. The next, the people fear; and the next, the people hate... When the best leader's work is done the people say, 'We did it ourselves!' ~Lao Tzu
Print  Pages 1 2  All Go Up
testmy.net Broadband  |  Main Forum  |  HELP!  |  Programming and Website Help  |  Topic: Flip an Image « previous next »
Jump to:  

    
testmy.net's forum is proudly Powered by SMF | SMF © 2006-2007, Simple Machines LLC
Bookmark: Del.icio.us    StumbleUpon
 
 

 

© 1999-2008 testmy.net - Contact - Legal - Facts & FAQs
Page Loading Stats: This forum Page created in 0.119 seconds with 54 queries.