Welcome Guest, Not a member yet? Register   Sign In
image turning from portrait to landscape when resizing
#1

[eluser]jaume[/eluser]
Any idea on how to avoid this?

I take a picture with my camera and shows as a portrait on the screen, I resize it and becomes landscape oriented... the mystery is served! Wink
#2

[eluser]jedd[/eluser]
Your resizing software is broken. It is resetting the Orientation component of your EXIF data.

Solution - get a better bit of software. ImageMagick is a good candidate.


EDIT: actually, I cheat with this - as part of my after-shoot processing, I adjust the physical orientation of all my shots to the appropriate angle (eg. jpegrotate), and then I run a jpegexiforient script across the lot that sets the exif orientation to top-left. I really hate having to deal with image orientation issues, and this solves the problem forever.
#3

[eluser]jaume[/eluser]
GD 2.3.5 is broken?!
#4

[eluser]jaume[/eluser]
do you know a way to read the exif orientation from php and set it again after resizing to avoid this problem?
#5

[eluser]jedd[/eluser]
Reading EXIF data from within PHP is the easy bit. Writing it back again is impossible AFAIK (I looked for this a while ago, as I wanted to create cache images on the fly, and replicate the whole EXIF data into them). You can of course do system() calls out to binaries, and this is what I ended up doing.

This comes down to what operating system you're running more than anything else. If you've got a real OS, it's very easy. I use ImageMagick's convert , which seems to copy across the whole EXIF chunk as it goes. And I use Guido Vollbeding's exifautotran to transform and convert orientation back to '1' (top-left).
#6

[eluser]jaume[/eluser]
I've got a REAL Ubuntu! Wink I'll check it out. Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB