Rotate jpg file based on EXIF data

Posted on 2008-10-27
Last Modified: 2012-05-05
I am not sure there is a solution for what I want to do but I thought I would ask anyways...

I have a .net application that gets xml from an external source with images.
I am loading the xml and images and displaying them, no image attributes are contained in the XML file.
Some images are lanscape and some portrait

Is there a way somehow how to use the EXIF data in the JPG to work out whether the shot should be displayed horizontally or vertically and rotate the image as neccassary???
Question by:clearchannel
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2

Author Comment

ID: 22865531
Those links don't really help with what I want to do. Sorry.
They relate to extractng the EXif data and lossless image support, neither refer to the image orientation etc.

Expert Comment

ID: 22865821
Both posts give details on how to get the PropertyItems from the EXIF data.
If I'm not mistaken the ProprtyItem you're interested in PropertyItem 274 - the Orientation tag.
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.


Author Comment

ID: 22865887
As you just linked to other EE posts, Can you point out where then as I did not see any reference.

Accepted Solution

openshac earned 500 total points
ID: 22866093
I think all the articles talk about using the PropertyItems so you just need to be able to read those first.
Then I think you're interested in PropertyItem 274 - the Orientation tag.

Expert Comment

ID: 22866137
>>so you just need to be able to read those first

The PropertyItems collection that is (not the articles)

Didn't mean to sound condescending ;-)

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question