Pictures get rotated to previous state after uploading...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
vargadanis
Forum Contributor
Posts: 158
Joined: Sun Jun 01, 2008 3:48 am
Contact:

Pictures get rotated to previous state after uploading...

Post by vargadanis »

Hi!

It's been long since I last posted here. RL sucks ^_^
I wrote a small script that uploads pictures then resamples them. I have a bit of problem with it.
So let's say I take a picture with my camera in standing format:

Code: Select all

+----+
|    |
|    |
+----+
and not in landscape:

Code: Select all

+-------+
|       | 
+-------+
I upload them from my camera to the computer and use FSpot to rotate them into the right position. (Usually means 90 degrees to the left)
After I pick the already rotated picture to upload and resample it is handled in it's original orientation. Therefore the picture that was shot in a standing format and then rotated to landscape is uploaded as standing and not as landscape.
What can I do with this?

PS: I needed to small character pics because I am not sure that these are the words I am to use for the orientation of the picture
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Pictures get rotated to previous state after uploading...

Post by onion2k »

By the sound of it this "FSpot" app isn't actually rotating the image, it's just changing the rotation marker in the image's EXIF data. Try rotating the image with something else.
User avatar
vargadanis
Forum Contributor
Posts: 158
Joined: Sun Jun 01, 2008 3:48 am
Contact:

Re: Pictures get rotated to previous state after uploading...

Post by vargadanis »

I see... I thought that it will be something like that...
Do you happen to know any tools that will actually rotate the picture? And it must be simple enough so that my parents can use it so photoshop, gimp are out of question.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Pictures get rotated to previous state after uploading...

Post by onion2k »

Irfanview is about the best free one.

Alternatively, if your server has the exif reader extension and GD, you could write something that automatically rotates them proper using PHP. There's some examples of how to do that in the PHP manual comments. Eg http://uk.php.net/manual/en/function.ex ... .php#76964
User avatar
vargadanis
Forum Contributor
Posts: 158
Joined: Sun Jun 01, 2008 3:48 am
Contact:

Re: Pictures get rotated to previous state after uploading...

Post by vargadanis »

Thanx for the tips :)
Post Reply